mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 20:35:19 +00:00
fix: temp chat perm
This commit is contained in:
parent
2a8a2f1ba3
commit
508fde70ff
2 changed files with 26 additions and 17 deletions
|
|
@ -902,8 +902,15 @@
|
||||||
|
|
||||||
const initNewChat = async () => {
|
const initNewChat = async () => {
|
||||||
console.log('initNewChat');
|
console.log('initNewChat');
|
||||||
if ($user?.role !== 'admin' && $user?.permissions?.chat?.temporary_enforced) {
|
if ($user?.role !== 'admin') {
|
||||||
await temporaryChatEnabled.set(true);
|
if ($user?.permissions?.chat?.temporary_enforced) {
|
||||||
|
await temporaryChatEnabled.set(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$user?.permissions?.chat?.temporary) {
|
||||||
|
await temporaryChatEnabled.set(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($settings?.temporaryChatByDefault ?? false) {
|
if ($settings?.temporaryChatByDefault ?? false) {
|
||||||
|
|
|
||||||
|
|
@ -713,24 +713,26 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
{#if $user.role === 'admin' || $user?.permissions?.chat?.temporary}
|
||||||
<div class=" py-0.5 flex w-full justify-between">
|
<div>
|
||||||
<div id="temp-chat-default-label" class=" self-center text-xs">
|
<div class=" py-0.5 flex w-full justify-between">
|
||||||
{$i18n.t('Temporary Chat by Default')}
|
<div id="temp-chat-default-label" class=" self-center text-xs">
|
||||||
</div>
|
{$i18n.t('Temporary Chat by Default')}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center gap-2 p-1">
|
<div class="flex items-center gap-2 p-1">
|
||||||
<Switch
|
<Switch
|
||||||
ariaLabelledbyId="temp-chat-default-label"
|
ariaLabelledbyId="temp-chat-default-label"
|
||||||
tooltip={true}
|
tooltip={true}
|
||||||
bind:state={temporaryChatByDefault}
|
bind:state={temporaryChatByDefault}
|
||||||
on:change={() => {
|
on:change={() => {
|
||||||
saveSettings({ temporaryChatByDefault });
|
saveSettings({ temporaryChatByDefault });
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/if}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class=" py-0.5 flex w-full justify-between">
|
<div class=" py-0.5 flex w-full justify-between">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue