Skip to content

Commit

Permalink
Merge pull request #100 from nomandhoni-cs/develop
Browse files Browse the repository at this point in the history
Fiexed auto update notification
  • Loading branch information
nomandhoni-cs authored Nov 19, 2024
2 parents 972fa73 + b852717 commit dfc229e
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 dfc229e

Please sign in to comment.