about summary refs log tree commit diff
path: root/assets/src/components/IncomingRequests.svelte
blob: 1db50af2094063ae1af901ed0c93de943b369d84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<script lang="ts">
    import { getToken, joinShareChannel } from "../network/socket";
    import requests from "../stores/requests";

    const startConnection = async () => {
        const token = await getToken();
        joinShareChannel(token);
        return token;
    };
</script>

{#await startConnection()}
    <h3>Fetching token...</h3>
{:then token}
    <h3>Your token is <b>{token}</b>.</h3>

    {#each $requests as request}
        <p>{JSON.stringify(request)}</p>
    {/each}
{/await}