Skip to content
Open
Changes from all commits
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
14 changes: 13 additions & 1 deletion src/main/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -1171,8 +1171,20 @@ app.whenReady().then(() =>
owner: 'jgraph'
})

if (store == null || (!disableUpdate && !store.get('dontCheckUpdates')))
// Cache update check - configurable interval (default: 24 hours)
const DEFAULT_UPDATE_CHECK_HOURS = 24;
const updateCheckHours = store?.get('updateCheckIntervalHours') ?? DEFAULT_UPDATE_CHECK_HOURS;
const UPDATE_CHECK_INTERVAL = updateCheckHours * 60 * 60 * 1000;
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