Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/main/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -1171,8 +1171,18 @@ app.whenReady().then(() =>
owner: 'jgraph'
})

if (store == null || (!disableUpdate && !store.get('dontCheckUpdates')))
// Cache update check - only check once per 24 hours to avoid repeated messages
const UPDATE_CHECK_INTERVAL = 24 * 60 * 60 * 1000; // 24 hours
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this UPDATE_CHECK_INTERVAL configurable. Hardcoding 24h looks like a kludge. What if I want to check once per week?

const lastUpdateCheck = store?.get('lastUpdateCheck') || 0;
const shouldCheckUpdates = Date.now() - lastUpdateCheck > UPDATE_CHECK_INTERVAL;

if (store == null || (!disableUpdate && !store.get('dontCheckUpdates') && shouldCheckUpdates))
{
if (store != null)
{
store.set('lastUpdateCheck', Date.now());
}

autoUpdater.checkForUpdates()
}
})
Expand Down