Fix condition

This commit is contained in:
Manav Rathi
2024-06-13 14:39:36 +05:30
parent 4e9ff3024c
commit e9f10f77d9

View File

@@ -190,11 +190,10 @@ export const skipAppUpdate = (version: string) =>
*/
export const canShowWhatsNew = (mainWindow: BrowserWindow) => {
const version = userPreferences.get("whatsNewShownVersion");
if (version) {
if (compareVersions(version, app.getVersion()) <= 0) {
log.debug(() => `Downgrade from ${version}, skipping what's new`);
return;
}
if (version && compareVersions(app.getVersion(), version) <= 0) {
// We have shown What's New earlier, but it was for a version same as or
// newer than the current version. Nothing to do now.
return;
}
mainWindow.webContents.send("showWhatsNew");
};