Spaces:
Sleeping
Sleeping
Commit
•
ed27197
1
Parent(s):
b7b2c8c
🩹 Fix settigns invalidation
Browse files
src/routes/+layout.server.ts
CHANGED
@@ -31,10 +31,9 @@ export const load: LayoutServerLoad = async ({ locals, depends, url }) => {
|
|
31 |
// If the active model in settings is not valid, set it to the default model. This can happen if model was disabled.
|
32 |
if (settings && !validateModel(models).safeParse(settings?.activeModel).success) {
|
33 |
settings.activeModel = defaultModel.id;
|
34 |
-
await collections.settings.updateOne(
|
35 |
-
{
|
36 |
-
|
37 |
-
);
|
38 |
}
|
39 |
|
40 |
return {
|
|
|
31 |
// If the active model in settings is not valid, set it to the default model. This can happen if model was disabled.
|
32 |
if (settings && !validateModel(models).safeParse(settings?.activeModel).success) {
|
33 |
settings.activeModel = defaultModel.id;
|
34 |
+
await collections.settings.updateOne(authCondition(locals), {
|
35 |
+
$set: { activeModel: defaultModel.id },
|
36 |
+
});
|
|
|
37 |
}
|
38 |
|
39 |
return {
|