coyotte508 HF staff commited on
Commit
ed27197
1 Parent(s): b7b2c8c

🩹 Fix settigns invalidation

Browse files
Files changed (1) hide show
  1. src/routes/+layout.server.ts +3 -4
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
- { sessionId: locals.sessionId },
36
- { $set: { activeModel: defaultModel.id } }
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 {