Merge pull request #1286 from keepassxreboot/fix/version_error_message

Fix version error message on options page
This commit is contained in:
Sami Vänttinen 2021-03-29 07:00:23 +03:00 committed by GitHub
commit cd01082051
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -194,12 +194,17 @@ kpxcEvent.pageClearLogins = async function(tab, alreadyCalled) {
}
};
kpxcEvent.compareVersion = async function(tab, args = []) {
return keepass.compareVersion(args[0], args[1]);
};
// All methods named in this object have to be declared BEFORE this!
kpxcEvent.messageHandlers = {
'add_credentials': keepass.addCredentials,
'associate': keepass.associate,
'check_database_hash': keepass.checkDatabaseHash,
'check_update_keepassxc': kpxcEvent.onCheckUpdateKeePassXC,
'compare_version': kpxcEvent.compareVersion,
'create_new_group': keepass.createNewGroup,
'enable_automatic_reconnect': keepass.enableAutomaticReconnect,
'disable_automatic_reconnect': keepass.disableAutomaticReconnect,

View file

@ -273,7 +273,7 @@ options.initGeneralSettings = function() {
}
};
options.showKeePassXCVersions = function(response) {
options.showKeePassXCVersions = async function(response) {
if (response.current === '') {
response.current = 'unknown';
}
@ -286,7 +286,12 @@ options.showKeePassXCVersions = function(response) {
$('#tab-about span.kpxcVersion').text(response.current);
$('#tab-general-settings button.checkUpdateKeePassXC:first').attr('disabled', false);
if (response.current.startsWith('2.6') || response.current === '2.5.3-snapshot') {
const result = await browser.runtime.sendMessage({
action: 'compare_version',
args: [ '2.6.0', response.current ]
});
if (result) {
$('#tab-general-settings #versionRequiredAlert').hide();
} else {
$('#tab-general-settings #showGroupNameInAutocomplete').attr('disabled', true);