refac: show changelog behaviour

This commit is contained in:
Timothy J. Baek 2024-10-23 00:38:59 -07:00
parent 2897c25b99
commit 8514ed148a
2 changed files with 6 additions and 3 deletions

View File

@ -2,12 +2,13 @@
import { onMount, getContext } from 'svelte';
import { Confetti } from 'svelte-confetti';
import { WEBUI_NAME, config } from '$lib/stores';
import { WEBUI_NAME, config, settings } from '$lib/stores';
import { WEBUI_VERSION } from '$lib/constants';
import { getChangelog } from '$lib/apis';
import Modal from './common/Modal.svelte';
import { updateUserSettings } from '$lib/apis/users';
const i18n = getContext('i18n');
@ -104,8 +105,10 @@
</div>
<div class="flex justify-end pt-3 text-sm font-medium">
<button
on:click={() => {
on:click={async () => {
localStorage.version = $config.version;
await settings.set({ ...$settings, ...{ version: $config.version } });
await updateUserSettings(localStorage.token, { ui: $settings });
show = false;
}}
class=" px-4 py-2 bg-emerald-700 hover:bg-emerald-800 text-gray-100 transition rounded-lg"

View File

@ -191,7 +191,7 @@
});
if ($user.role === 'admin') {
showChangelog.set(localStorage.version !== $config.version);
showChangelog.set($settings?.version !== $config.version);
}
if ($page.url.searchParams.get('temporary-chat') === 'true') {