all is change; in change is all again made new
This commit is contained in:
29
src/views/Unlock.svelte
Normal file
29
src/views/Unlock.svelte
Normal 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>
|
Reference in New Issue
Block a user