Skip to content

Commit cd01082

Browse files
author
Sami Vänttinen
authored
Merge pull request #1286 from keepassxreboot/fix/version_error_message
Fix version error message on options page
2 parents 71497ad + b1faedd commit cd01082

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

keepassxc-browser/background/event.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,17 @@ kpxcEvent.pageClearLogins = async function(tab, alreadyCalled) {
194194
}
195195
};
196196

197+
kpxcEvent.compareVersion = async function(tab, args = []) {
198+
return keepass.compareVersion(args[0], args[1]);
199+
};
200+
197201
// All methods named in this object have to be declared BEFORE this!
198202
kpxcEvent.messageHandlers = {
199203
'add_credentials': keepass.addCredentials,
200204
'associate': keepass.associate,
201205
'check_database_hash': keepass.checkDatabaseHash,
202206
'check_update_keepassxc': kpxcEvent.onCheckUpdateKeePassXC,
207+
'compare_version': kpxcEvent.compareVersion,
203208
'create_new_group': keepass.createNewGroup,
204209
'enable_automatic_reconnect': keepass.enableAutomaticReconnect,
205210
'disable_automatic_reconnect': keepass.disableAutomaticReconnect,

keepassxc-browser/options/options.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ options.initGeneralSettings = function() {
273273
}
274274
};
275275

276-
options.showKeePassXCVersions = function(response) {
276+
options.showKeePassXCVersions = async function(response) {
277277
if (response.current === '') {
278278
response.current = 'unknown';
279279
}
@@ -286,7 +286,12 @@ options.showKeePassXCVersions = function(response) {
286286
$('#tab-about span.kpxcVersion').text(response.current);
287287
$('#tab-general-settings button.checkUpdateKeePassXC:first').attr('disabled', false);
288288

289-
if (response.current.startsWith('2.6') || response.current === '2.5.3-snapshot') {
289+
const result = await browser.runtime.sendMessage({
290+
action: 'compare_version',
291+
args: [ '2.6.0', response.current ]
292+
});
293+
294+
if (result) {
290295
$('#tab-general-settings #versionRequiredAlert').hide();
291296
} else {
292297
$('#tab-general-settings #showGroupNameInAutocomplete').attr('disabled', true);

0 commit comments

Comments
 (0)