fix(dashboard): fix crash when opening dash while not logged in
This commit is contained in:
		@@ -1,11 +1,14 @@
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
    import { Container, Row, Col, Card, CardHeader, CardBody, CardTitle, Alert, Label, Input, Button, Spinner } from 'sveltestrap';
 | 
			
		||||
    import FaUserLock from 'svelte-icons/fa/FaUserLock.svelte';
 | 
			
		||||
    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}>
 | 
			
		||||
@@ -101,4 +105,5 @@
 | 
			
		||||
			</Card>
 | 
			
		||||
		</Col>
 | 
			
		||||
	</Row>
 | 
			
		||||
</Container>
 | 
			
		||||
</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 FaUserLock from 'svelte-icons/fa/FaUserLock.svelte';
 | 
			
		||||
    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}>
 | 
			
		||||
@@ -103,4 +106,5 @@ import Member from './Member.svelte';
 | 
			
		||||
			</Card>
 | 
			
		||||
		</Col>
 | 
			
		||||
	</Row>
 | 
			
		||||
</Container>
 | 
			
		||||
</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>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user