Skip to content

Commit

Permalink
refactor(settings): use async await (#1062)
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed Apr 24, 2024
1 parent 62926fc commit 5119a68
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/routes/Settings.tsx
Expand Up @@ -55,14 +55,16 @@ export const SettingsRoute: FC = () => {
};

useEffect(() => {
ipcRenderer.invoke('get-platform').then((result: string) => {
(async () => {
const result = await ipcRenderer.invoke('get-platform');
setIsLinux(result === 'linux');
setIsMacOS(result === 'darwin');
});
})();

ipcRenderer.invoke('get-app-version').then((result: string) => {
(async () => {
const result = await ipcRenderer.invoke('get-app-version');
setAppVersion(result);
});
})();

ipcRenderer.on('update-native-theme', (_, updatedTheme: Theme) => {
if (settings.theme === Theme.SYSTEM) {
Expand Down

0 comments on commit 5119a68

Please sign in to comment.