Commit c55e99ea authored by SpinShare's avatar SpinShare

code clarity

parent fbba4a32
...@@ -43,22 +43,22 @@ ...@@ -43,22 +43,22 @@
'hasXDDifficulty' 'hasXDDifficulty'
], ],
mounted: function() { mounted: function() {
var difficultyObject = [ let difficultyObject = [
{difficulty: 0, value: this.$props.hasEasyDifficulty}, {difficulty: 0, value: this.$props.hasEasyDifficulty},
{difficulty: 1, value: this.$props.hasNormalDifficulty}, {difficulty: 1, value: this.$props.hasNormalDifficulty},
{difficulty: 2, value: this.$props.hasHardDifficulty}, {difficulty: 2, value: this.$props.hasHardDifficulty},
{difficulty: 3, value: this.$props.hasExpertDifficulty}, {difficulty: 3, value: this.$props.hasExpertDifficulty},
{difficulty: 4, value: this.$props.hasXDDifficulty} {difficulty: 4, value: this.$props.hasXDDifficulty}
] ]
var trueCount = 0; let trueCount = 0;
var singleDiff = {}; let singleDiff = {};
difficultyObject.forEach(e => { difficultyObject.forEach(e => {
if (e['value'] == true) { if (e['value'] == true) {
trueCount++ trueCount++
singleDiff == e singleDiff == e
} }
}); });
if (trueCount == 1) {this.play(singleDiff.difficulty)} if (trueCount == 1) this.play(singleDiff.difficulty);
ipcRenderer.on("overlays-close", () => { ipcRenderer.on("overlays-close", () => {
this.close(); this.close();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment