move app state to store
This commit is contained in:
@ -1,18 +1,18 @@
|
||||
<script>
|
||||
import { onMount, createEventDispatcher } from 'svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { invoke } from '@tauri-apps/api/tauri';
|
||||
|
||||
import { appState } from '../lib/state.js';
|
||||
import { navigate } from '../lib/routing.js';
|
||||
import Nav from '../ui/Nav.svelte';
|
||||
import Icon from '../ui/Icon.svelte';
|
||||
import Link from '../ui/Link.svelte';
|
||||
|
||||
export let appState;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
onMount(async () => {
|
||||
// will block until a request comes in
|
||||
let req = await appState.pendingRequests.get();
|
||||
appState.currentRequest = req;
|
||||
let req = await $appState.pendingRequests.get();
|
||||
$appState.currentRequest = req;
|
||||
navigate('Approve');
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user