mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Save to default group when no group are found
This commit is contained in:
parent
c90cff8f65
commit
43f1a4a912
1 changed files with 8 additions and 4 deletions
|
|
@ -136,18 +136,22 @@ kpxcBanner.create = async function(credentials = {}) {
|
|||
};
|
||||
|
||||
kpxcBanner.saveNewCredentials = async function(credentials = {}) {
|
||||
const saveToDefaultGroup = async function(creds) {
|
||||
const args = [ creds.username, creds.password, creds.url ];
|
||||
const res = await sendMessage('add_credentials', args);
|
||||
kpxcBanner.verifyResult(res);
|
||||
};
|
||||
|
||||
const result = await sendMessage('get_database_groups');
|
||||
if (!result || !result.groups) {
|
||||
console.log('Error: Empty result from get_database_groups');
|
||||
await saveToDefaultGroup(credentials);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!result.defaultGroupAlwaysAsk) {
|
||||
if (result.defaultGroup === '' || result.defaultGroup === DEFAULT_BROWSER_GROUP) {
|
||||
// Default group is used
|
||||
const args = [ credentials.username, credentials.password, credentials.url ];
|
||||
const res = await sendMessage('add_credentials', args);
|
||||
kpxcBanner.verifyResult(res);
|
||||
await saveToDefaultGroup(credentials);
|
||||
return;
|
||||
} else {
|
||||
// A specified group is used
|
||||
|
|
|
|||
Loading…
Reference in a new issue