From 2ec47ecc743593ef816b1b7e7f7e903428b065f3 Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Thu, 4 Jun 2020 17:50:56 +0100 Subject: [PATCH] Use different setting flag print expected values --- .../tabs/user/AppearanceUserSettingsTab.tsx | 12 +++++++++--- src/settings/Settings.js | 4 ++-- src/settings/watchers/FontWatcher.ts | 14 ++++++++------ 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx index bcd87b290a..9b77493c4f 100644 --- a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx @@ -62,7 +62,7 @@ export default class AppearanceUserSettingsTab extends React.Component { this.setState({fontSize: size.toString()}); - SettingsStore.setValue("fontSize", null, SettingLevel.DEVICE, size); + SettingsStore.setValue("baseFontSize", null, SettingLevel.DEVICE, size - FontWatcher.SIZE_DIFF); }; private onValidateFontSize = async ({value}: Pick): Promise => { @@ -151,7 +151,13 @@ export default class AppearanceUserSettingsTab extends React.Component { - // Externally we tell the user the font is size 15. Internally we use 10. - const fontSize = Math.max(Math.min(FontWatcher.MAX_SIZE, size), FontWatcher.MIN_SIZE) - 5; + console.log({size}) + const fontSize = Math.max(Math.min(FontWatcher.MAX_SIZE, size), FontWatcher.MIN_SIZE); if (fontSize !== size) { - SettingsStore.setValue("fontSize", null, SettingLevel.Device, fontSize); + SettingsStore.setValue("baseFontSize", null, SettingLevel.DEVICE, fontSize); } (document.querySelector(":root")).style.fontSize = toPx(fontSize); };