From bebf77dffcec8465542ebaaa13384a469e85e04f Mon Sep 17 00:00:00 2001 From: eythaann Date: Thu, 25 Jul 2024 02:31:35 -0500 Subject: [PATCH] docs(schemas): update schemas --- documentation/schemas/placeholder.schema.json | 2 +- documentation/schemas/settings.schema.json | 4 ++++ src/apps/shared/schemas/Settings.ts | 7 ++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/documentation/schemas/placeholder.schema.json b/documentation/schemas/placeholder.schema.json index 5e9df0da..01fe1cb6 100644 --- a/documentation/schemas/placeholder.schema.json +++ b/documentation/schemas/placeholder.schema.json @@ -29,7 +29,7 @@ "properties": { "id": { "type": "string", - "default": "64622d88-d889-435a-ac21-15f19839ade6" + "default": "e0113b78-2a87-4706-b69c-d565384ab101" }, "type": { "type": "string", diff --git a/documentation/schemas/settings.schema.json b/documentation/schemas/settings.schema.json index c78584b9..596e8a29 100644 --- a/documentation/schemas/settings.schema.json +++ b/documentation/schemas/settings.schema.json @@ -662,6 +662,10 @@ "dev_tools": { "type": "boolean", "default": false + }, + "language": { + "type": "string", + "default": "en" } }, "additionalProperties": false, diff --git a/src/apps/shared/schemas/Settings.ts b/src/apps/shared/schemas/Settings.ts index 85f2b15e..698f64a9 100644 --- a/src/apps/shared/schemas/Settings.ts +++ b/src/apps/shared/schemas/Settings.ts @@ -89,7 +89,12 @@ export const SettingsSchema = z.object({ }) .default(['default']), dev_tools: z.boolean().default(false), - language: z.string().default(() => navigator.language.split('-')[0] || 'en'), + language: z.string().default(() => { + if (globalThis.navigator) { + return globalThis.navigator.language.split('-')[0] || 'en'; + } + return 'en'; + }), }); export interface ISettings {