Switch update check default interval to Never

This commit is contained in:
varjolintu 2021-09-12 09:18:05 +03:00
parent c956f41c90
commit 9264f2fb62
6 changed files with 22 additions and 11 deletions

View file

@ -135,7 +135,7 @@ kpxcEvent.onCheckUpdateKeePassXC = async function() {
}; };
kpxcEvent.onUpdateAvailableKeePassXC = async function() { kpxcEvent.onUpdateAvailableKeePassXC = async function() {
return (page.settings.checkUpdateKeePassXC > 0) ? keepass.keePassXCUpdateAvailable() : false; return (page.settings.checkUpdateKeePassXC != CHECK_UPDATE_NEVER) ? keepass.keePassXCUpdateAvailable() : false;
}; };
kpxcEvent.onRemoveCredentialsFromTabInformation = async function(tab) { kpxcEvent.onRemoveCredentialsFromTabInformation = async function(tab) {

View file

@ -955,7 +955,7 @@ keepass.setcurrentKeePassXCVersion = function(version) {
}; };
keepass.keePassXCUpdateAvailable = function() { keepass.keePassXCUpdateAvailable = function() {
if (page.settings.checkUpdateKeePassXC && page.settings.checkUpdateKeePassXC > 0) { if (page.settings.checkUpdateKeePassXC && page.settings.checkUpdateKeePassXC != CHECK_UPDATE_NEVER) {
const lastChecked = (keepass.latestKeePassXC.lastChecked) ? new Date(keepass.latestKeePassXC.lastChecked) : new Date(1986, 11, 21); 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); const daysSinceLastCheck = Math.floor(((new Date()).getTime() - lastChecked.getTime()) / 86400000);
if (daysSinceLastCheck >= page.settings.checkUpdateKeePassXC) { if (daysSinceLastCheck >= page.settings.checkUpdateKeePassXC) {

View file

@ -8,7 +8,7 @@ const defaultSettings = {
autoReconnect: false, autoReconnect: false,
autoRetrieveCredentials: true, autoRetrieveCredentials: true,
autoSubmit: false, autoSubmit: false,
checkUpdateKeePassXC: 3, checkUpdateKeePassXC: CHECK_UPDATE_NEVER,
clearCredentialsTimeout: 10, clearCredentialsTimeout: 10,
colorTheme: 'system', colorTheme: 'system',
credentialSorting: SORT_BY_GROUP_AND_TITLE, credentialSorting: SORT_BY_GROUP_AND_TITLE,

View file

@ -12,6 +12,12 @@ const SORT_BY_USERNAME = 'sortByUsername';
const SORT_BY_GROUP_AND_TITLE = 'sortByGroupAndTitle'; const SORT_BY_GROUP_AND_TITLE = 'sortByGroupAndTitle';
const SORT_BY_GROUP_AND_USERNAME = 'sortByGroupAndUsername'; const SORT_BY_GROUP_AND_USERNAME = 'sortByGroupAndUsername';
// Update check intervals
const CHECK_UPDATE_NEVER = 0;
const CHECK_UPDATE_THREE_DAYS = 3;
const CHECK_UPDATE_ONE_WEEK = 7;
const CHECK_UPDATE_ONE_MONTH = 30;
const schemeSegment = '(\\*|http|https|ws|wss|ftp)'; const schemeSegment = '(\\*|http|https|ws|wss|ftp)';
const hostSegment = '(\\*|(?:\\*\\.)?(?:[^/*]+))?'; const hostSegment = '(\\*|(?:\\*\\.)?(?:[^/*]+))?';
const pathSegment = '(.*)'; const pathSegment = '(.*)';

View file

@ -278,20 +278,20 @@
<div class="mt-3"> <div class="mt-3">
<div data-i18n="optionsRadioText"></div> <div data-i18n="optionsRadioText"></div>
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="checkUpdateKeePassXC" id="inlineRadio1" value="3"> <input class="form-check-input" type="radio" name="checkUpdateKeePassXC" id="checkUpdateThreeDays">
<label class="form-check-label" for="inlineRadio1"><span data-i18n="optionsRadioThreeDays"></span></label> <label class="form-check-label" for="checkUpdateThreeDays"><span data-i18n="optionsRadioThreeDays"></span></label>
</div> </div>
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="checkUpdateKeePassXC" id="inlineRadio2" value="7"> <input class="form-check-input" type="radio" name="checkUpdateKeePassXC" id="checkUpdateOneWeek">
<label class="form-check-label" for="inlineRadio2"><span data-i18n="optionsRadioWeek"></span></label> <label class="form-check-label" for="checkUpdateOneWeek"><span data-i18n="optionsRadioWeek"></span></label>
</div> </div>
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="checkUpdateKeePassXC" id="inlineRadio3" value="30"> <input class="form-check-input" type="radio" name="checkUpdateKeePassXC" id="checkUpdateOneMonth">
<label class="form-check-label" for="inlineRadio3"><span data-i18n="optionsRadioMonth"></span></label> <label class="form-check-label" for="checkUpdateOneMonth"><span data-i18n="optionsRadioMonth"></span></label>
</div> </div>
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="checkUpdateKeePassXC" id="inlineRadio4" value="0"> <input class="form-check-input" type="radio" name="checkUpdateKeePassXC" id="checkUpdateNever">
<label class="form-check-label" for="inlineRadio4"><span data-i18n="optionsRadioNever"></span></label> <label class="form-check-label" for="checkUpdateNever"><span data-i18n="optionsRadioNever"></span></label>
</div> </div>
</div> </div>
</div> </div>

View file

@ -93,6 +93,11 @@ options.initGeneralSettings = function() {
} }
}); });
$('#tab-general-settings input[type=radio]#checkUpdateThreeDays').val(CHECK_UPDATE_THREE_DAYS);
$('#tab-general-settings input[type=radio]#checkUpdateOneWeek').val(CHECK_UPDATE_ONE_WEEK);
$('#tab-general-settings input[type=radio]#checkUpdateOneMonth').val(CHECK_UPDATE_ONE_MONTH);
$('#tab-general-settings input[type=radio]#checkUpdateNever').val(CHECK_UPDATE_NEVER);
$('#tab-general-settings input[type=range]').val(options.settings['redirectAllowance']); $('#tab-general-settings input[type=range]').val(options.settings['redirectAllowance']);
$('#redirectAllowanceLabel').text(tr('optionsRedirectAllowance', $('#redirectAllowanceLabel').text(tr('optionsRedirectAllowance',
options.settings['redirectAllowance'] === 11 ? 'Infinite' : String(options.settings['redirectAllowance']))); options.settings['redirectAllowance'] === 11 ? 'Infinite' : String(options.settings['redirectAllowance'])));