switch to invokes instead of emits

This commit is contained in:
Joseph Montanaro
2022-12-13 16:50:44 -08:00
parent 48269855e5
commit 9055fa41aa
11 changed files with 91 additions and 40 deletions

View File

@ -9,16 +9,12 @@
let passphrase = '';
async function unlock() {
console.log('invoking unlock command.')
let res = await invoke('unlock', {passphrase});
if (res) {
appState.credentialStatus = 'unlocked';
console.log('Unlock successful!');
if (appState.currentRequest) {
dispatch('navigate', {target: 'ShowApproved'});
}
try {
await invoke('unlock', {passphrase});
}
else {
// indicate decryption failed
catch (e) {
console.log('Unlock error:', e);
}
}
</script>