<script>
    import { onMount, createEventDispatcher } from 'svelte';

    export let appState;

    const dispatch = createEventDispatcher();

    onMount(async () => {
        // will block until a request comes in
        let req = await appState.pendingRequests.get();
        console.log(req);
        appState.currentRequest = req;
        console.log('Got credentials request from queue.');
        console.log(appState);
        dispatch('navigate', {target: 'Approve'});
    });
</script>

<h1 class="text-4xl text-gray-300">Creddy</h1>