<script>
    import {globals} from "$lib/stores.js";

    let globalvars;

    globals.subscribe(value => {
        globalvars = value;
    });
</script>

{#if typeof globalvars.user !== 'undefined'}
    <h1>Welcome {globalvars.user.name}</h1>
{:else}
    <h1 class="h1">Blackbird Chess</h1>
    <a href="/account/login" class="anchor">Go to login page</a>
{/if}