Pin the UI locale to the language setting and add theme + language selectors with a dark palette
This commit is contained in:
1 parent
b30b9a3bc1
commit
d404e1e72a
18 files changed
+176
-11
No files matched your search
@@ -87,6 +87,7 @@ export class SnapshotService {
|
||||
|
||||
return {
|
||||
activeOrgId,
|
||||
uiPreferences: this.resolveUiPreferences(),
|
||||
organizations,
|
||||
employees: list(this.db, "employees", "created_at asc"),
|
||||
agents,
|
||||
@@ -178,6 +179,14 @@ export class SnapshotService {
|
||||
if (stored && known.includes(stored)) return stored;
|
||||
return known[0] ?? null;
|
||||
}
|
||||
|
||||
private resolveUiPreferences(): AppSnapshot["uiPreferences"] {
|
||||
const row = this.db.prepare("select theme, language from app_state where id = 1")
|
||||
.get() as { theme: string; language: string } | undefined;
|
||||
const theme = row?.theme === "light" || row?.theme === "dark" ? row.theme : "system";
|
||||
const language = row?.language === "zh" ? "zh" : "en";
|
||||
return { theme, language };
|
||||
}
|
||||
}
|
||||
|
||||
function buildProviderRateLimits(
|
||||
|
||||
Reference in new issue
Block a user