mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Make sure checkUpdateKeePassXC is an integer
This commit is contained in:
parent
8d429b70b9
commit
d2e43abd61
2 changed files with 4 additions and 3 deletions
|
|
@ -137,7 +137,7 @@ kpxcEvent.onCheckUpdateKeePassXC = async function() {
|
|||
};
|
||||
|
||||
kpxcEvent.onUpdateAvailableKeePassXC = async function() {
|
||||
return (page.settings.checkUpdateKeePassXC !== CHECK_UPDATE_NEVER) ? keepass.keePassXCUpdateAvailable() : false;
|
||||
return (Number(page.settings.checkUpdateKeePassXC) !== CHECK_UPDATE_NEVER) ? keepass.keePassXCUpdateAvailable() : false;
|
||||
};
|
||||
|
||||
kpxcEvent.onRemoveCredentialsFromTabInformation = async function(tab) {
|
||||
|
|
|
|||
|
|
@ -800,10 +800,11 @@ keepass.setcurrentKeePassXCVersion = function(version) {
|
|||
};
|
||||
|
||||
keepass.keePassXCUpdateAvailable = function() {
|
||||
if (page.settings.checkUpdateKeePassXC && page.settings.checkUpdateKeePassXC !== CHECK_UPDATE_NEVER) {
|
||||
const checkUpdate = Number(page.settings.checkUpdateKeePassXC);
|
||||
if (checkUpdate !== CHECK_UPDATE_NEVER) {
|
||||
const lastChecked = (keepass.latestKeePassXC.lastChecked) ? new Date(keepass.latestKeePassXC.lastChecked) : new Date(1986, 11, 21);
|
||||
const daysSinceLastCheck = Math.floor(((new Date()).getTime() - lastChecked.getTime()) / 86400000);
|
||||
if (daysSinceLastCheck >= page.settings.checkUpdateKeePassXC) {
|
||||
if (daysSinceLastCheck >= checkUpdate) {
|
||||
keepass.checkForNewKeePassXCVersion();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue