Merge remote-tracking branch 'upstream/dev' into feat/oauth
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
prompts,
|
||||
documents,
|
||||
tags,
|
||||
banners,
|
||||
showChangelog,
|
||||
config
|
||||
} from '$lib/stores';
|
||||
@@ -33,6 +34,8 @@
|
||||
import ShortcutsModal from '$lib/components/chat/ShortcutsModal.svelte';
|
||||
import ChangelogModal from '$lib/components/ChangelogModal.svelte';
|
||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||
import { getBanners } from '$lib/apis/configs';
|
||||
import { getUserSettings } from '$lib/apis/users';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
@@ -70,7 +73,13 @@
|
||||
// IndexedDB Not Found
|
||||
}
|
||||
|
||||
settings.set(JSON.parse(localStorage.getItem('settings') ?? '{}'));
|
||||
const userSettings = await getUserSettings(localStorage.token);
|
||||
|
||||
if (userSettings) {
|
||||
await settings.set(userSettings.ui);
|
||||
} else {
|
||||
await settings.set(JSON.parse(localStorage.getItem('settings') ?? '{}'));
|
||||
}
|
||||
|
||||
await Promise.all([
|
||||
(async () => {
|
||||
@@ -82,6 +91,9 @@
|
||||
(async () => {
|
||||
documents.set(await getDocs(localStorage.token));
|
||||
})(),
|
||||
(async () => {
|
||||
banners.set(await getBanners(localStorage.token));
|
||||
})(),
|
||||
(async () => {
|
||||
tags.set(await getAllChatTags(localStorage.token));
|
||||
})()
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
}
|
||||
await checkOauthCallback();
|
||||
loaded = true;
|
||||
if (($config?.auth_trusted_header ?? false) || $config?.auth === false) {
|
||||
if (($config?.features.auth_trusted_header ?? false) || $config?.features.auth === false) {
|
||||
await signInHandler();
|
||||
}
|
||||
});
|
||||
@@ -130,7 +130,7 @@
|
||||
</div> -->
|
||||
|
||||
<div class="w-full sm:max-w-md px-10 min-h-screen flex flex-col text-center">
|
||||
{#if ($config?.auth_trusted_header ?? false) || $config?.auth === false}
|
||||
{#if ($config?.features.auth_trusted_header ?? false) || $config?.features.auth === false}
|
||||
<div class=" my-auto pb-10 w-full">
|
||||
<div
|
||||
class="flex items-center justify-center gap-3 text-xl sm:text-2xl text-center font-bold dark:text-gray-200"
|
||||
@@ -222,7 +222,7 @@
|
||||
{mode === 'signin' ? $i18n.t('Sign in') : $i18n.t('Create Account')}
|
||||
</button>
|
||||
|
||||
{#if $config.enable_signup}
|
||||
{#if $config?.features.enable_signup}
|
||||
<div class=" mt-4 text-sm text-center">
|
||||
{mode === 'signin'
|
||||
? $i18n.t("Don't have an account?")
|
||||
|
||||
@@ -98,12 +98,6 @@
|
||||
: convertMessagesToHistory(chatContent.messages);
|
||||
title = chatContent.title;
|
||||
|
||||
let _settings = JSON.parse(localStorage.getItem('settings') ?? '{}');
|
||||
await settings.set({
|
||||
..._settings,
|
||||
system: chatContent.system ?? _settings.system,
|
||||
options: chatContent.options ?? _settings.options
|
||||
});
|
||||
autoScroll = true;
|
||||
await tick();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user