diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 2b50beb4d..22276ca10 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -889,15 +889,8 @@ const initNewChat = async () => { console.log('initNewChat'); - if ($user?.role !== 'admin') { - if ($user?.permissions?.chat?.temporary_enforced) { - await temporaryChatEnabled.set(true); - } - - if (!$user?.permissions?.chat?.temporary) { - await temporaryChatEnabled.set(false); - return; - } + if ($user?.role !== 'admin' && $user?.permissions?.chat?.temporary_enforced) { + await temporaryChatEnabled.set(true); } if ($settings?.temporaryChatByDefault ?? false) { @@ -909,6 +902,10 @@ } } + if ($user?.role !== 'admin' && !$user?.permissions?.chat?.temporary) { + await temporaryChatEnabled.set(false); + } + const availableModels = $models .filter((m) => !(m?.info?.meta?.hidden ?? false)) .map((m) => m.id); @@ -1738,7 +1735,11 @@ ) ); - if (hasImages && !(model.info?.meta?.capabilities?.vision ?? true) && !imageGenerationEnabled) { + if ( + hasImages && + !(model.info?.meta?.capabilities?.vision ?? true) && + !imageGenerationEnabled + ) { toast.error( $i18n.t('Model {{modelName}} is not vision capable', { modelName: model.name ?? model.id