fix(dashboard): fix crash when opening dash while not logged in
This commit is contained in:
parent
0a048cdc32
commit
0d774a7c9e
@ -1,11 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { Container, Row, Col, Card, CardHeader, CardBody, CardTitle, Alert, Label, Input, Button, Spinner } from 'sveltestrap';
|
||||
import { navigate } from 'svelte-navigator';
|
||||
import FaUserLock from 'svelte-icons/fa/FaUserLock.svelte';
|
||||
|
||||
import api from '../api';
|
||||
import { GroupPrivacy, System } from '../api/types';
|
||||
const user: System = JSON.parse(localStorage.getItem("pk-user"));
|
||||
|
||||
if (!user) navigate('/');
|
||||
|
||||
// const capitalize = (str: string) => str[0].toUpperCase() + str.substr(1);
|
||||
|
||||
let loading = false;
|
||||
@ -52,6 +55,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if user}
|
||||
<Container>
|
||||
<Row>
|
||||
<Col class="mx-auto" xs={12} lg={11} xl={10}>
|
||||
@ -102,3 +106,4 @@
|
||||
</Col>
|
||||
</Row>
|
||||
</Container>
|
||||
{/if}
|
@ -1,12 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { Container, Row, Col, Card, CardHeader, CardBody, CardTitle, Label, Input, Button, Spinner, Alert } from 'sveltestrap';
|
||||
import { navigate } from 'svelte-navigator';
|
||||
import FaUserLock from 'svelte-icons/fa/FaUserLock.svelte';
|
||||
|
||||
import api from '../api';
|
||||
import { MemberPrivacy, System } from '../api/types';
|
||||
import Member from './Member.svelte';
|
||||
const user: System = JSON.parse(localStorage.getItem("pk-user"));
|
||||
|
||||
if (!user) navigate('/');
|
||||
|
||||
// const capitalize = (str: string) => str[0].toUpperCase() + str.substr(1);
|
||||
|
||||
let loading = false;
|
||||
@ -54,6 +56,7 @@ import Member from './Member.svelte';
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if user}
|
||||
<Container>
|
||||
<Row>
|
||||
<Col class="mx-auto" xs={12} lg={11} xl={10}>
|
||||
@ -104,3 +107,4 @@ import Member from './Member.svelte';
|
||||
</Col>
|
||||
</Row>
|
||||
</Container>
|
||||
{/if}
|
@ -75,6 +75,7 @@
|
||||
{#if user && user.banner && ((settings && settings.appearance.banner_top) || !settings)}
|
||||
<div class="banner" style="background-image: url({user.banner})" />
|
||||
{/if}
|
||||
{#if user}
|
||||
<Container>
|
||||
<Row>
|
||||
<Col class="mx-auto" xs={12} lg={11} xl={10}>
|
||||
@ -93,6 +94,7 @@
|
||||
</Col>
|
||||
</Row>
|
||||
</Container>
|
||||
{/if}
|
||||
|
||||
<svelte:head>
|
||||
<title>PluralKit | dash</title>
|
||||
|
Loading…
Reference in New Issue
Block a user