|
@@ -22,7 +22,9 @@
|
|
currentChatPage,
|
|
currentChatPage,
|
|
tags,
|
|
tags,
|
|
temporaryChatEnabled,
|
|
temporaryChatEnabled,
|
|
- isLastActiveTab
|
|
|
|
|
|
+ isLastActiveTab,
|
|
|
|
+ isApp,
|
|
|
|
+ appVersion
|
|
} from '$lib/stores';
|
|
} from '$lib/stores';
|
|
import { goto } from '$app/navigation';
|
|
import { goto } from '$app/navigation';
|
|
import { page } from '$app/stores';
|
|
import { page } from '$app/stores';
|
|
@@ -41,6 +43,7 @@
|
|
import { bestMatchingLanguage } from '$lib/utils';
|
|
import { bestMatchingLanguage } from '$lib/utils';
|
|
import { getAllTags, getChatList } from '$lib/apis/chats';
|
|
import { getAllTags, getChatList } from '$lib/apis/chats';
|
|
import NotificationToast from '$lib/components/NotificationToast.svelte';
|
|
import NotificationToast from '$lib/components/NotificationToast.svelte';
|
|
|
|
+ import AppControls from '$lib/components/app/AppControls.svelte';
|
|
|
|
|
|
setContext('i18n', i18n);
|
|
setContext('i18n', i18n);
|
|
|
|
|
|
@@ -177,6 +180,17 @@
|
|
};
|
|
};
|
|
|
|
|
|
onMount(async () => {
|
|
onMount(async () => {
|
|
|
|
+ if (window?.electronAPI) {
|
|
|
|
+ const res = await window.electronAPI.send({
|
|
|
|
+ type: 'version'
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (res) {
|
|
|
|
+ isApp.set(true);
|
|
|
|
+ appVersion.set(res.version);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
// Listen for messages on the BroadcastChannel
|
|
// Listen for messages on the BroadcastChannel
|
|
bc.onmessage = (event) => {
|
|
bc.onmessage = (event) => {
|
|
if (event.data === 'active') {
|
|
if (event.data === 'active') {
|
|
@@ -324,7 +338,17 @@
|
|
</svelte:head>
|
|
</svelte:head>
|
|
|
|
|
|
{#if loaded}
|
|
{#if loaded}
|
|
- <slot />
|
|
|
|
|
|
+ {#if $isApp}
|
|
|
|
+ <div class="flex flex-row h-screen">
|
|
|
|
+ <AppControls />
|
|
|
|
+
|
|
|
|
+ <div class="w-full flex-1">
|
|
|
|
+ <slot />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ {:else}
|
|
|
|
+ <slot />
|
|
|
|
+ {/if}
|
|
{/if}
|
|
{/if}
|
|
|
|
|
|
<Toaster
|
|
<Toaster
|