generated from nhcarrigan/template
feat: add notification sounds
This commit is contained in:
+21
-8
@@ -1,7 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from "svelte";
|
||||
import { initializeTauriListeners } from "$lib/tauri";
|
||||
import { onMount, onDestroy } from "svelte";
|
||||
import { initializeTauriListeners, cleanupTauriListeners } from "$lib/tauri";
|
||||
import { configStore, applyTheme } from "$lib/stores/config";
|
||||
import "$lib/notifications/testNotifications";
|
||||
import Terminal from "$lib/components/Terminal.svelte";
|
||||
import InputBar from "$lib/components/InputBar.svelte";
|
||||
import StatusBar from "$lib/components/StatusBar.svelte";
|
||||
@@ -9,13 +10,25 @@
|
||||
import PermissionModal from "$lib/components/PermissionModal.svelte";
|
||||
import ConfigSidebar from "$lib/components/ConfigSidebar.svelte";
|
||||
|
||||
onMount(async () => {
|
||||
await initializeTauriListeners();
|
||||
await configStore.loadConfig();
|
||||
let initialized = false;
|
||||
|
||||
// Apply saved theme on startup
|
||||
const config = configStore.getConfig();
|
||||
applyTheme(config.theme);
|
||||
onMount(async () => {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
await initializeTauriListeners();
|
||||
await configStore.loadConfig();
|
||||
|
||||
// Apply saved theme on startup
|
||||
const config = configStore.getConfig();
|
||||
applyTheme(config.theme);
|
||||
}
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
if (initialized) {
|
||||
cleanupTauriListeners();
|
||||
initialized = false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user