mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #1856 from keepassxreboot/fix/improve_fill_on_username_icon_click
Improve filling from Username Icon
This commit is contained in:
commit
3fafeaadde
3 changed files with 7 additions and 12 deletions
|
|
@ -32,14 +32,10 @@ kpxcBanner.destroy = async function() {
|
|||
|
||||
kpxcBanner.create = async function(credentials = {}) {
|
||||
const connectedDatabase = await sendMessage('get_connected_database');
|
||||
if (!kpxc.settings.showLoginNotifications || kpxcBanner.created || connectedDatabase.identifier === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if database is closed
|
||||
const state = await sendMessage('check_database_hash');
|
||||
if (state === '') {
|
||||
//kpxcUI.createNotification('error', tr('rememberErrorDatabaseClosed'));
|
||||
if (!kpxc.settings.showLoginNotifications
|
||||
|| kpxcBanner.created
|
||||
|| connectedDatabase.identifier === null
|
||||
|| kpxc.databaseState !== DatabaseState.UNLOCKED) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ kpxc.detectDatabaseChange = async function(response) {
|
|||
// If user has requested a manual fill through context menu the actual credential filling
|
||||
// is handled here when the opened database has been regognized. It's not a pretty hack.
|
||||
const manualFill = await sendMessage('page_get_manual_fill');
|
||||
if (manualFill !== ManualFill.NONE) {
|
||||
if (manualFill !== ManualFill.NONE && kpxc.combinations.length > 0) {
|
||||
await kpxcFill.fillInFromActiveElement(manualFill === ManualFill.PASSWORD);
|
||||
await sendMessage('page_set_manual_fill', ManualFill.NONE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,8 +131,7 @@ const iconClicked = async function(field, icon) {
|
|||
return;
|
||||
}
|
||||
|
||||
const databaseHash = await sendMessage('check_database_hash');
|
||||
if (databaseHash === '') {
|
||||
if (kpxc.databaseState !== DatabaseState.UNLOCKED) {
|
||||
// Triggers database unlock
|
||||
await sendMessage('page_set_manual_fill', ManualFill.BOTH);
|
||||
await sendMessage('get_database_hash', [ false, true ]); // Set triggerUnlock to true
|
||||
|
|
@ -148,7 +147,7 @@ const getIconClassName = function(state = DatabaseState.UNLOCKED) {
|
|||
if (state === DatabaseState.LOCKED) {
|
||||
return (isFirefox() ? 'lock-moz' : 'lock');
|
||||
} else if (state === DatabaseState.DISCONNECTED) {
|
||||
return (isFirefox() ? 'lock-disconnected' : 'disconnected');
|
||||
return (isFirefox() ? 'disconnected-moz' : 'disconnected');
|
||||
}
|
||||
|
||||
return (isFirefox() ? 'unlock-moz' : 'unlock');
|
||||
|
|
|
|||
Loading…
Reference in a new issue