Skip to content

Commit

Permalink
Merge pull request #101 from nomandhoni-cs/master
Browse files Browse the repository at this point in the history
Fixed auto update notification
  • Loading branch information
nomandhoni-cs authored Nov 19, 2024
2 parents 9358577 + dfc229e commit 22b7309
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/hooks/useAutoUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ export const useUpdater = () => {
`UPDATE config SET value = ? WHERE key = 'isUpdateAvailable';`,
["true"]
);
} else {
console.log("No update available");
setIsUpdateAvailable(false);
const db = await Database.load("sqlite:appconfig.db");
await db.execute(
`UPDATE config SET value = ? WHERE key = 'isUpdateAvailable';`,
["false"]
);
}
} catch (error) {
console.error("Error during update check:", error);
Expand Down Expand Up @@ -53,13 +61,6 @@ export const useUpdater = () => {
}
});

// Update the database value after installation
const db = await Database.load("sqlite:appconfig.db");
await db.execute(
`UPDATE config SET value = ? WHERE key = 'isUpdateAvailable';`,
["false"]
);

console.log("Update installed");
await relaunch();
}
Expand Down

0 comments on commit 22b7309

Please sign in to comment.