mirror of
https://github.com/open-webui/open-webui
synced 2025-06-04 03:37:35 +00:00
refac: show changelog behaviour
This commit is contained in:
parent
2897c25b99
commit
8514ed148a
@ -2,12 +2,13 @@
|
|||||||
import { onMount, getContext } from 'svelte';
|
import { onMount, getContext } from 'svelte';
|
||||||
import { Confetti } from 'svelte-confetti';
|
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 { WEBUI_VERSION } from '$lib/constants';
|
||||||
import { getChangelog } from '$lib/apis';
|
import { getChangelog } from '$lib/apis';
|
||||||
|
|
||||||
import Modal from './common/Modal.svelte';
|
import Modal from './common/Modal.svelte';
|
||||||
|
import { updateUserSettings } from '$lib/apis/users';
|
||||||
|
|
||||||
const i18n = getContext('i18n');
|
const i18n = getContext('i18n');
|
||||||
|
|
||||||
@ -104,8 +105,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end pt-3 text-sm font-medium">
|
<div class="flex justify-end pt-3 text-sm font-medium">
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={async () => {
|
||||||
localStorage.version = $config.version;
|
localStorage.version = $config.version;
|
||||||
|
await settings.set({ ...$settings, ...{ version: $config.version } });
|
||||||
|
await updateUserSettings(localStorage.token, { ui: $settings });
|
||||||
show = false;
|
show = false;
|
||||||
}}
|
}}
|
||||||
class=" px-4 py-2 bg-emerald-700 hover:bg-emerald-800 text-gray-100 transition rounded-lg"
|
class=" px-4 py-2 bg-emerald-700 hover:bg-emerald-800 text-gray-100 transition rounded-lg"
|
||||||
|
@ -191,7 +191,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
if ($user.role === 'admin') {
|
if ($user.role === 'admin') {
|
||||||
showChangelog.set(localStorage.version !== $config.version);
|
showChangelog.set($settings?.version !== $config.version);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($page.url.searchParams.get('temporary-chat') === 'true') {
|
if ($page.url.searchParams.get('temporary-chat') === 'true') {
|
||||||
|
Loading…
Reference in New Issue
Block a user