Open
Conversation
AlexisMora
reviewed
Feb 27, 2026
AlexisMora
reviewed
Mar 3, 2026
src/apps/main/auth/service.ts
Outdated
|
|
||
| for (const [key, value] of Object.entries(savedConfig)) { | ||
| ConfigStore.set(key, value); | ||
| ConfigStore.set(key as keyof AppStore, value as AppStore[keyof AppStore]); |
src/apps/main/config/handlers.ts
Outdated
|
|
||
| ipcMain.on('set-config-key', (_, { key, value }) => { | ||
| setConfigKey(key, value); | ||
| setConfigKey({ key, value } as SetConfigKeyProps); |
src/apps/main/config/service.ts
Outdated
Comment on lines
9
to
18
| export type StoredValues = keyof AppStore; | ||
|
|
||
| type SetConfigKeyProps = { key: 'preferedLanguage'; value: Language } | { key: 'preferedTheme'; value: ConfigTheme }; | ||
|
|
||
| export type { SetConfigKeyProps }; | ||
|
|
||
| export const getConfigKey = <T extends StoredValues>(key: T): AppStore[T] => { | ||
| return store.get(key); | ||
| return electronStore.get(key); | ||
| }; | ||
|
|
There was a problem hiding this comment.
I would create a type file instead of having these in here
src/apps/main/config/theme.ts
Outdated
| import { Theme, ConfigTheme, ThemeData } from './theme.types'; | ||
|
|
||
| export function getTheme(): ThemeData { | ||
| const configTheme = electronStore.get('preferedTheme') as ConfigTheme; |
| @@ -0,0 +1,27 @@ | |||
| import { nativeTheme } from 'electron'; | |||
There was a problem hiding this comment.
Also: I have created src/core folder for these types of functionalities regarding overall app behaviour
| i18next.changeLanguage(lang); | ||
| dayjs.locale(DayJsLocales[lang as Language]); | ||
| window.electron.setConfigKey('preferedLanguage', lang); | ||
| window.electron.setConfigKey('preferedLanguage', lang as Language); |
AlexisMora
reviewed
Mar 3, 2026
Comment on lines
+9
to
+39
| @@ -25,16 +27,16 @@ export default function ThemePicker(): JSX.Element { | |||
|
|
|||
| const refreshPreferedTheme = async () => { | |||
| const theme = await window.electron.getConfigKey('preferedTheme'); | |||
| if (theme === '' || theme === null) { | |||
| if (!theme) { | |||
| setSelectedTheme(DEFAULT_THEME); | |||
| } else { | |||
| setSelectedTheme(theme as Theme); | |||
| setSelectedTheme(theme as ConfigTheme); | |||
| } | |||
| }; | |||
|
|
|||
| const updatePreferedTheme = (theme: string) => { | |||
| window.electron.toggleDarkMode(theme as Theme); | |||
| window.electron.setConfigKey('preferedTheme', theme); | |||
| window.electron.toggleDarkMode(theme as ConfigTheme); | |||
| window.electron.setConfigKey('preferedTheme', theme as ConfigTheme); | |||
There was a problem hiding this comment.
We should get rid of forcing the types like this with the as type assertion whenever possible
AlexisMora
reviewed
Mar 9, 2026
Comment on lines
33
to
36
| if (!lang) { | ||
| setSelectedLanguage(DEFAULT_LANGUAGE); | ||
| } else { | ||
| setSelectedLanguage(lang); |
There was a problem hiding this comment.
Suggested change
| if (!lang) { | |
| setSelectedLanguage(DEFAULT_LANGUAGE); | |
| } else { | |
| setSelectedLanguage(lang); | |
| setSelectedLanguage(lang ?? DEFAULT_LANGUAGE); |
Comment on lines
+28
to
+31
| if (!theme) { | ||
| setSelectedTheme(DEFAULT_THEME); | ||
| } else { | ||
| setSelectedTheme(theme as Theme); | ||
| setSelectedTheme(theme); |
There was a problem hiding this comment.
Suggested change
| if (!theme) { | |
| setSelectedTheme(DEFAULT_THEME); | |
| } else { | |
| setSelectedTheme(theme as Theme); | |
| setSelectedTheme(theme); | |
| setSelectedTheme(theme ?? DEFAULT_THEME); |
src/apps/shared/types/Theme.ts
Outdated
Comment on lines
+3
to
+6
| /** All selectable theme values including 'system' */ | ||
| export type ConfigTheme = (typeof themes)[number]; | ||
|
|
||
| export const DEFAULT_THEME = 'system'; | ||
| /** Resolved (applied) theme — never 'system' */ |
There was a problem hiding this comment.
Are this comments necessary? seems like they lack context
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What is Changed / Added
Application settings management has been improved with the addition of reactive language and theme configuration. These settings now update dynamically throughout the application in real-time.
Why
This enhancement will enable us to standardize the onboarding experience to match the Windows implementation, as the two platforms currently differ in this regard.