Skip to content

Commit 5119a68

Browse files
authored
refactor(settings): use async await (#1062)
1 parent 62926fc commit 5119a68

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/routes/Settings.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ export const SettingsRoute: FC = () => {
5555
};
5656

5757
useEffect(() => {
58-
ipcRenderer.invoke('get-platform').then((result: string) => {
58+
(async () => {
59+
const result = await ipcRenderer.invoke('get-platform');
5960
setIsLinux(result === 'linux');
6061
setIsMacOS(result === 'darwin');
61-
});
62+
})();
6263

63-
ipcRenderer.invoke('get-app-version').then((result: string) => {
64+
(async () => {
65+
const result = await ipcRenderer.invoke('get-app-version');
6466
setAppVersion(result);
65-
});
67+
})();
6668

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

0 commit comments

Comments
 (0)