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

@ -7,11 +7,15 @@
const dispatch = createEventDispatcher();
async function approve() {
if (appState.credentialStatus === 'unlocked') {
let status = await invoke('get-session-status');
if (status === 'unlocked') {
dispatch('navigate', {target: 'ShowApproved'});
}
else if (status === 'locked') {
dispatch('navigate', {target: 'Unlock'})
}
else {
dispatch('navigate', {target: 'Unlock'});
dispatch('navigate', {target: 'EnterCredentials'});
}
}