Fix Node.js version of memory game not working properly (#3789)

The rules require comparing if tiles are equal, which used to be a string comparison as we just
converted the image to a path. With ImageData this doesn't
work anymore, so this patch proposes an optional path
property that makes the code also a tad bit more readable.
This commit is contained in:
Simon Hausmann 2023-10-31 08:50:32 +01:00 committed by GitHub
parent 52a0cd5c13
commit 55085d43af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 3 deletions

View file

@ -42,7 +42,7 @@ mainWindow.check_if_pair_solved = function () {
index: tile2_index
} = flipped_tiles[1];
let is_pair_solved = tile1.image === tile2.image;
let is_pair_solved = tile1.image.path === tile2.image.path;
if (is_pair_solved) {
tile1.solved = true;
model.setRowData(tile1_index, tile1);