mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Save to Root group if defined without default group
This commit is contained in:
parent
059d0ccf50
commit
017361584f
1 changed files with 8 additions and 1 deletions
|
|
@ -128,9 +128,16 @@ kpxcBanner.saveNewCredentials = async function(credentials = {}) {
|
|||
// Or when default group is not set and defaultGroupAskAlways is disabled -> save to default
|
||||
if ((result.groups === undefined || (result.groups.length > 0 && result.groups[0].children.length === 0)) ||
|
||||
(!result.defaultGroupAlwaysAsk && (result.defaultGroup === '' || result.defaultGroup === DEFAULT_BROWSER_GROUP))) {
|
||||
let args = [ credentials.username, credentials.password, credentials.url ];
|
||||
|
||||
// If root group is defined by the user, and there's no default browser group, save the credentials to the root group
|
||||
if (result.groups[0].children.length === 0 && result.defaultGroup.toLowerCase() === 'root') {
|
||||
args.push(result.groups[0].name, result.groups[0].uuid);
|
||||
}
|
||||
|
||||
const res = await browser.runtime.sendMessage({
|
||||
action: 'add_credentials',
|
||||
args: [ credentials.username, credentials.password, credentials.url ]
|
||||
args: args
|
||||
});
|
||||
kpxcBanner.verifyResult(res);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue