refac
This commit is contained in:
@@ -889,15 +889,8 @@
|
|||||||
|
|
||||||
const initNewChat = async () => {
|
const initNewChat = async () => {
|
||||||
console.log('initNewChat');
|
console.log('initNewChat');
|
||||||
if ($user?.role !== 'admin') {
|
if ($user?.role !== 'admin' && $user?.permissions?.chat?.temporary_enforced) {
|
||||||
if ($user?.permissions?.chat?.temporary_enforced) {
|
await temporaryChatEnabled.set(true);
|
||||||
await temporaryChatEnabled.set(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$user?.permissions?.chat?.temporary) {
|
|
||||||
await temporaryChatEnabled.set(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($settings?.temporaryChatByDefault ?? false) {
|
if ($settings?.temporaryChatByDefault ?? false) {
|
||||||
@@ -909,6 +902,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($user?.role !== 'admin' && !$user?.permissions?.chat?.temporary) {
|
||||||
|
await temporaryChatEnabled.set(false);
|
||||||
|
}
|
||||||
|
|
||||||
const availableModels = $models
|
const availableModels = $models
|
||||||
.filter((m) => !(m?.info?.meta?.hidden ?? false))
|
.filter((m) => !(m?.info?.meta?.hidden ?? false))
|
||||||
.map((m) => m.id);
|
.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(
|
toast.error(
|
||||||
$i18n.t('Model {{modelName}} is not vision capable', {
|
$i18n.t('Model {{modelName}} is not vision capable', {
|
||||||
modelName: model.name ?? model.id
|
modelName: model.name ?? model.id
|
||||||
|
|||||||
Reference in New Issue
Block a user