all is change; in change is all again made new

This commit is contained in:
2022-11-27 22:03:15 -08:00
parent cee43342b9
commit c19b573b26
10 changed files with 241 additions and 46 deletions

29
src/views/Unlock.svelte Normal file
View File

@ -0,0 +1,29 @@
<script>
import { invoke } from '@tauri-apps/api/tauri';
import { createEventDispatcher } from 'svelte';
export let appState;
const dispatch = createEventDispatcher();
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'});
}
}
else {
// indicate decryption failed
}
}
</script>
<form action="#" on:submit|preventDefault="{unlock}">
<div class="text-gray-200">Enter your passphrase:</div>
<input class="text-gray-200 bg-zinc-800" type="password" placeholder="correct horse battery staple" bind:value="{passphrase}" />
</form>