Skip to content

Commit

Permalink
fix(unlock-database): move the reject errorHandler into the then.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sulfyderz committed Jan 27, 2025
1 parent 1f7fe10 commit 5e0e578
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions extensions/keepassxc/src/components/unlock-database.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@ export default function unlockDatabase({ setIsUnlocked }: { setIsUnlocked: (isUn
style: Toast.Style.Animated,
title: "Unlocking Database...",
});
KeePassLoader.checkCredentials(value.password, value.keyFile[0])
.then(() => {
showToast({
style: Toast.Style.Success,
title: "Database Unlocked",
});
KeePassLoader.cacheCredentials(value.password, value.keyFile[0]);
KeePassLoader.setCredentials(value.password, value.keyFile[0]);
setIsUnlocked(true);
})
.catch(showToastCliErrors);
KeePassLoader.checkCredentials(value.password, value.keyFile[0]).then(() => {
showToast({
style: Toast.Style.Success,
title: "Database Unlocked",
});
KeePassLoader.cacheCredentials(value.password, value.keyFile[0]);
KeePassLoader.setCredentials(value.password, value.keyFile[0]);
setIsUnlocked(true);
}, showToastCliErrors);
},
validation: {
password: (value) => {
Expand Down

0 comments on commit 5e0e578

Please sign in to comment.