Skip to content

Commit

Permalink
fix: Fix update issue with gameIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
ximu3 committed Jan 11, 2025
1 parent 16c0be0 commit df143dd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/database/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ export async function setDBValue(
): Promise<void> {
try {
await setValue(await getDataPath(dbName), path, value)
if (noIpcAction) {
return
}
const mainWindow = BrowserWindow.getAllWindows()[0]
mainWindow.webContents.send('reload-db-values', dbName)
if (dbName.startsWith('games/')) {
if (dbName.includes('record.json')) {
await updateGameRecord(dbName.split('/')[1])
}
await updateGameIndex(dbName.split('/')[1])
}
if (noIpcAction) {
return
}
const mainWindow = BrowserWindow.getAllWindows()[0]
mainWindow.webContents.send('reload-db-values', dbName)
} catch (error) {
log.error(`Failed to set value for ${dbName} at ${path.join('.')}`, error)
}
Expand Down

0 comments on commit df143dd

Please sign in to comment.