Do not resume game after undoing with 0 mines

Fixes #51.
This commit is contained in:
Florine W. Dekker 2020-08-02 20:49:18 +02:00
parent 836aaa6271
commit a6c2776b06
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
2 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "minesweeper",
"version": "0.0.63",
"version": "0.0.64",
"description": "Just Minesweeper!",
"author": "Felix W. Dekker",
"browser": "dist/bundle.js",

View File

@ -198,12 +198,13 @@ export class Field {
if (this.coveredRemaining === this.size - this.mineCount) {
if (this.startTimes.length !== this.endTimes.length)
this.endTimes.push(Date.now());
} else {
} else if (this.coveredRemaining > 0) {
this.lost = false;
this.won = false;
if (this.startTimes.length === this.endTimes.length)
this.startTimes.push(Date.now());
}
this.lost = false;
this.won = false;
}
/**