From f79e2c8333decb9a00f4a3ac1e940a7edd3b5c55 Mon Sep 17 00:00:00 2001 From: Domagoj Kriskovic Date: Wed, 22 Jan 2025 13:17:44 +0100 Subject: [PATCH] Expose fontSize to scopeSettings (for extensions) (#23033) * Expose fontSize to scopeSettings (for extensions) * Updated comment with fontSize property in IdeProvider context GitOrigin-RevId: 3f622d75aa206f2760a3a9ce0db0f31a91e73089 --- services/web/frontend/js/shared/context/ide-context.tsx | 1 + .../web/frontend/js/shared/context/user-settings-context.tsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/services/web/frontend/js/shared/context/ide-context.tsx b/services/web/frontend/js/shared/context/ide-context.tsx index f3d73984a3..630494ffb5 100644 --- a/services/web/frontend/js/shared/context/ide-context.tsx +++ b/services/web/frontend/js/shared/context/ide-context.tsx @@ -29,6 +29,7 @@ export const IdeProvider: FC<{ * - `editor.open_doc_id`, * - `settings.theme` * - `settings.keybindings` + * - `settings.fontSize` */ useEffect(() => { window.overleaf = { diff --git a/services/web/frontend/js/shared/context/user-settings-context.tsx b/services/web/frontend/js/shared/context/user-settings-context.tsx index 49f5d446d1..200f753c0e 100644 --- a/services/web/frontend/js/shared/context/user-settings-context.tsx +++ b/services/web/frontend/js/shared/context/user-settings-context.tsx @@ -37,6 +37,7 @@ type UserSettingsContextValue = { type ScopeSettings = { overallTheme: 'light' | 'dark' keybindings: Keybindings + fontSize: number } export const UserSettingsContext = createContext< @@ -54,6 +55,7 @@ export const UserSettingsProvider: FC = ({ children }) => { setScopeSettings({ overallTheme: userSettings.overallTheme === 'light-' ? 'light' : 'dark', keybindings: userSettings.mode === 'none' ? 'default' : userSettings.mode, + fontSize: userSettings.fontSize, }) }, [setScopeSettings, userSettings])