feat: make system components require the system classes

This commit is contained in:
Spectralitree
2021-12-12 07:45:42 +01:00
parent be1a2423f9
commit ed257afcc6
5 changed files with 9 additions and 7 deletions

View File

@@ -5,7 +5,7 @@
import System from '../lib/system/Main.svelte';
import PKAPI from '../api';
import type Sys from '../api/system';
import Sys from '../api/system';
let isPublic = false;
@@ -24,7 +24,7 @@
});
// if there is no cached user, get the user from localstorage
let user = current ? current : JSON.parse(localStorage.getItem("pk-user"));
let user = new Sys(current ? current : JSON.parse(localStorage.getItem("pk-user")));
// since the user in localstorage can be outdated, fetch the user from the api again
if (!current) {
login(localStorage.getItem("pk-token"));