mirror of
https://github.com/open-webui/open-webui
synced 2025-04-08 06:35:04 +00:00
improve logic for tempchat enabled
This commit is contained in:
parent
70bb0562f3
commit
c68e18cf7e
@ -195,13 +195,16 @@
|
|||||||
showChangelog.set($settings?.version !== $config.version);
|
showChangelog.set($settings?.version !== $config.version);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($page.url.searchParams.get('temporary-chat') === 'true') {
|
// check if searchParam is set, if yes & user is allowed to use param, then param > permission
|
||||||
|
// If "temporary-chat=true" is set in the URL, always enable temporary chat
|
||||||
|
const searchParam = $page.url.searchParams.get('temporary-chat');
|
||||||
|
if (searchParam === 'true') {
|
||||||
temporaryChatEnabled.set(true);
|
temporaryChatEnabled.set(true);
|
||||||
}
|
// If "temporary-chat=false" is set in the URL, always disable temporary chat
|
||||||
|
} else if (searchParam === 'false') {
|
||||||
console.log($user?.permissions);
|
temporaryChatEnabled.set(false);
|
||||||
|
// If "temporary-chat" is not set in the URL, check if user has permission to use temporary chat
|
||||||
if ($user?.permissions?.chat?.temporary_enforced) {
|
} else if ($user?.permissions?.chat?.temporary_enforced) {
|
||||||
temporaryChatEnabled.set(true);
|
temporaryChatEnabled.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user