Skip to content

Commit

Permalink
move matrix init
Browse files Browse the repository at this point in the history
  • Loading branch information
Theaninova committed Nov 5, 2024
1 parent d68f1b1 commit c79237c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/routes/(app)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import { restoreFromFile } from "$lib/backup/backup";
import { goto } from "$app/navigation";
import { hotkeys } from "$lib/title";
import { initMatrixClient } from "$lib/chat/chat";
const locale =
((browser && localStorage.getItem("locale")) as Locales) || detectLocale();
Expand Down Expand Up @@ -66,9 +65,6 @@
if (browser && $userPreferences.autoConnect && (await canAutoConnect())) {
await initSerial();
}
if (browser) {
await initMatrixClient();
}
if (data.importFile) {
restoreFromFile(data.importFile);
Expand Down
10 changes: 9 additions & 1 deletion src/routes/(app)/chat/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
<script lang="ts">
import { isLoggedIn, matrix } from "$lib/chat/chat";
import { initMatrixClient, isLoggedIn, matrix } from "$lib/chat/chat";
import { flip } from "svelte/animate";
import { slide } from "svelte/transition";
import Login from "./Login.svelte";
import { onMount } from "svelte";
import { browser } from "$app/environment";
onMount(async () => {
if (browser) {
await initMatrixClient();
}
});
let { children } = $props();
Expand Down

0 comments on commit c79237c

Please sign in to comment.