feat: matrix

This commit is contained in:
2024-09-29 02:00:52 +02:00
parent 236e23086c
commit 2f0d8f2e1d
14 changed files with 376 additions and 246 deletions

View File

@@ -15,7 +15,6 @@
import { initSerial } from "$lib/serial/connection";
import type { LayoutData } from "./$types";
import { browser } from "$app/environment";
import BrowserWarning from "./BrowserWarning.svelte";
import "tippy.js/animations/shift-away.css";
import "tippy.js/dist/tippy.css";
import tippy from "tippy.js";
@@ -30,6 +29,7 @@
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();
@@ -66,6 +66,9 @@
if (browser && $userPreferences.autoConnect && (await canAutoConnect())) {
await initSerial();
}
if (browser) {
await initMatrixClient();
}
if (data.importFile) {
restoreFromFile(data.importFile);
@@ -128,10 +131,6 @@
</PageTransition>
<Footer />
{#if import.meta.env.TAURI_FAMILY === undefined && browser && !("serial" in navigator)}
<BrowserWarning />
{/if}
</div>
<style lang="scss">