basic system tray functionality
This commit is contained in:
@ -27,6 +27,9 @@
|
||||
if (event.shiftKey && (event.code === 'Enter' || event.code === 'NumpadEnter')) {
|
||||
approve();
|
||||
}
|
||||
else if (event.code === 'Escape') {
|
||||
deny();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -4,18 +4,31 @@
|
||||
import { invoke } from '@tauri-apps/api/tauri';
|
||||
|
||||
export let appState;
|
||||
let error = null;
|
||||
|
||||
onMount(async () => {
|
||||
const dispatch = createEventDispatcher();
|
||||
async function respond() {
|
||||
let response = {
|
||||
id: appState.currentRequest.id,
|
||||
approval: 'Denied',
|
||||
}
|
||||
await invoke('respond', {response});
|
||||
appState.currentRequest = null;
|
||||
});
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
window.setTimeout(() => dispatch('navigate', {target: 'Home'}), 3000);
|
||||
try {
|
||||
await invoke('respond', {response});
|
||||
appState.currentRequest = null;
|
||||
}
|
||||
catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
window.setTimeout(() => dispatch('navigate', {target: 'Home'}), 3000);
|
||||
}
|
||||
|
||||
onMount(respond);
|
||||
</script>
|
||||
|
||||
<h1 class="text-4xl text-gray-300">Denied!</h1>
|
||||
{#if error}
|
||||
<div class="text-red-400">{error}</div>
|
||||
{:else}
|
||||
<h1 class="text-4xl text-gray-300">Denied!</h1>
|
||||
{/if}
|
Reference in New Issue
Block a user