refac
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
import { compareVersion } from '$lib/utils';
|
||||
|
||||
import UpdateInfoToast from '$lib/components/layout/UpdateInfoToast.svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
@@ -53,6 +54,8 @@
|
||||
let DB = null;
|
||||
let localDBChats = [];
|
||||
|
||||
let version;
|
||||
|
||||
const getModels = async () => {
|
||||
return _getModels(localStorage.token);
|
||||
};
|
||||
@@ -216,28 +219,24 @@
|
||||
});
|
||||
|
||||
const checkForVersionUpdates = async () => {
|
||||
const version = await getVersionUpdates(localStorage.token).catch((error) => {
|
||||
version = await getVersionUpdates(localStorage.token).catch((error) => {
|
||||
return {
|
||||
current: WEBUI_VERSION,
|
||||
latest: WEBUI_VERSION
|
||||
};
|
||||
});
|
||||
|
||||
if (compareVersion(version.latest, version.current)) {
|
||||
toast.custom(UpdateInfoToast, {
|
||||
duration: Number.POSITIVE_INFINITY,
|
||||
position: 'bottom-right',
|
||||
componentProps: {
|
||||
version
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<SettingsModal bind:show={$showSettings} />
|
||||
<ChangelogModal bind:show={$showChangelog} />
|
||||
|
||||
{#if version && compareVersion(version.latest, version.current)}
|
||||
<div class=" absolute bottom-8 right-8 z-50" in:fade={{ duration: 100 }}>
|
||||
<UpdateInfoToast {version} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="app relative">
|
||||
<div
|
||||
class=" text-gray-700 dark:text-gray-100 bg-white dark:bg-gray-900 h-screen max-h-[100dvh] overflow-auto flex flex-row"
|
||||
|
||||
Reference in New Issue
Block a user