Skip to content

Commit

Permalink
Refactor id check in putSaveIntoIndexDB to use strict comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackRam-oss committed Nov 20, 2024
1 parent 345da0b commit d36a46c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utilities/save-utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function putSaveIntoIndexDB(info: Partial<GameSaveData> & { id?: nu
image: image,
...info,
}
if (!item.id) {
if (item.id === undefined) {
let lastSave = await getLastRowFromIndexDB<GameSaveData & { id: number }>(INDEXED_DB_SAVE_TABLE)
if (lastSave) {
item.id = lastSave.id + 1
Expand Down

0 comments on commit d36a46c

Please sign in to comment.