Skip to content

Commit

Permalink
Ready for first tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcop committed Feb 12, 2022
1 parent 0f12443 commit eca84d5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions public/default.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import url('./fonts/fonts.css');

button {
outline: none;
border: none;
Expand Down Expand Up @@ -30,6 +32,7 @@ input {

color: #dddddd;
background-color: #444444;
font-family: NotoSans;
}

input:hover {
Expand Down
4 changes: 2 additions & 2 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ onMount(() => {
<Titlebar />

<div class="background">
<Router primary={true}>
<Router>
<Route path="/"><Login /></Route>
<Route path="home"><Home /></Route>
<Route path="home" primary={true}><Home /></Route>
</Router>
</div>

Expand Down
6 changes: 3 additions & 3 deletions src/core/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import * as store from "@/stores";
export default function initStorage() {

// Save the username into local storage.
if (localStorage.getItem("username") != null && localStorage.getItem("username") != 'null')
store.user.set({ id: '...', name: localStorage.getItem("username") });
if (sessionStorage.getItem("username") != null && sessionStorage.getItem("username") != 'null')
store.user.set({ id: '...', name: sessionStorage.getItem("username") });
else store.user.set(null);
store.user.subscribe(user => localStorage.setItem("username", (user ? user.name : null)));
store.user.subscribe(user => sessionStorage.setItem("username", (user ? user.name : null)));

// Save the global chat into local storage.
if (localStorage.getItem("globalchat") != null && localStorage.getItem("globalchat") != 'null')
Expand Down
2 changes: 1 addition & 1 deletion src/nav/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ onMount(() => {
store.user.subscribe((user) => {
currentUser = user;
});
if (!currentUser) navigate('/');
if (!currentUser || !localStorage.getItem("username")) navigate('/');
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/nav/Login.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const join = () => {
input {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
font-family: CascadiaCode;
font-family: NotoSans;
}
button {
Expand Down

0 comments on commit eca84d5

Please sign in to comment.