Merge pull request #911 from keepassxreboot/bump_version_to_164

Bump version to 164 and fix the last bugs
This commit is contained in:
Sami Vänttinen 2020-06-15 18:39:45 +03:00 committed by GitHub
commit ba37da64c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 20 deletions

View file

@ -841,6 +841,7 @@ const initcb = async function() {
kpxc.initObserver();
}
await kpxc.updateDatabaseState();
await kpxc.initCredentialFields();
// Retrieve submitted credentials if available.
@ -1038,14 +1039,6 @@ kpxc.initCredentialFields = async function(forceCall, inputs) {
return;
}
// Check database closed status
const res = await browser.runtime.sendMessage({
action: 'get_status',
args: [ true ]
});
_databaseState = !res.keePassXCAvailable ? DatabaseState.DISCONNECTED : DatabaseState.LOCKED;
if (!kpxcFields.useDefinedCredentialFields()) {
// Get all combinations of username + password fields
kpxcFields.combinations = kpxcFields.getAllCombinations(inputs);
@ -1940,6 +1933,19 @@ kpxc.passwordFilled = async function() {
return await browser.runtime.sendMessage({ action: 'password_get_filled' });
};
kpxc.updateDatabaseState = async function() {
const res = await browser.runtime.sendMessage({
action: 'get_status',
args: [ true ]
});
if (!res.keePassXCAvailable) {
_databaseState = DatabaseState.DISCONNECTED;
return;
}
_databaseState = res.databaseClosed ? DatabaseState.LOCKED : DatabaseState.UNLOCKED;
};
const kpxcEvents = {};
@ -1964,13 +1970,7 @@ kpxcEvents.triggerActivatedTab = async function() {
// Doesn't run a second time because of _called.initCredentialFields set to true
kpxc.init();
// Update username field lock state
const res = await browser.runtime.sendMessage({
action: 'get_status',
args: [ true ]
});
_databaseState = !res.keePassXCAvailable ? DatabaseState.DISCONNECTED : DatabaseState.LOCKED;
await kpxc.updateDatabaseState();
kpxc.switchIcons();
// initCredentialFields calls also "retrieve_credentials", to prevent it

View file

@ -7,8 +7,8 @@ kpxcUsernameIcons.newIcon = function(field, databaseState = DatabaseState.DISCON
kpxcUsernameIcons.icons.push(new UsernameFieldIcon(field, databaseState));
};
kpxcUsernameIcons.switchIcon = function(locked) {
kpxcUsernameIcons.icons.forEach(u => u.switchIcon(locked));
kpxcUsernameIcons.switchIcon = function(state) {
kpxcUsernameIcons.icons.forEach(u => u.switchIcon(state));
};
@ -28,7 +28,7 @@ class UsernameFieldIcon extends Icon {
return;
}
this.icon.classList.remove('lock', 'moz-lock', 'unlock', 'moz-unlock', 'disconnected', 'moz-disconnected');
this.icon.classList.remove('lock', 'lock-moz', 'unlock', 'unlock-moz', 'disconnected', 'disconnected-moz');
this.icon.classList.add(getIconClassName(state));
this.icon.title = getIconText(state);
}

View file

@ -1,8 +1,8 @@
{
"manifest_version": 2,
"name": "KeePassXC-Browser",
"version": "1.6.3",
"version_name": "1.6.3",
"version": "1.6.4",
"version_name": "1.6.4",
"description": "__MSG_extensionDescription__",
"author": "KeePassXC Team",
"icons": {