File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed
ui/src/electron/constants Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ import {
13
13
initAutoUpdaterHandlers ,
14
14
launchApiServer ,
15
15
initCloudHandlers ,
16
+ electronStore ,
16
17
} from 'desktopSrc/lib'
17
18
import { wrapErrorMessageSensitiveData } from 'desktopSrc/utils'
18
19
import { configMain as config } from 'desktopSrc/config'
19
20
import { deepLinkHandler , deepLinkWindowHandler } from 'desktopSrc/lib/app/deep-link.handlers'
21
+ import { ElectronStorageItem } from 'uiSrc/electron/constants'
20
22
21
23
if ( ! config . isProduction ) {
22
24
const sourceMapSupport = require ( 'source-map-support' )
@@ -33,6 +35,8 @@ const init = async () => {
33
35
initTray ( )
34
36
initCloudHandlers ( )
35
37
38
+ nativeTheme . themeSource = electronStore ?. get ( ElectronStorageItem . themeSource ) || config . themeSource
39
+
36
40
checkForUpdate ( process . env . MANUAL_UPGRADES_LINK || process . env . UPGRADES_LINK )
37
41
38
42
app . setName ( config . name )
Original file line number Diff line number Diff line change 3
3
"defaultPort" : 5530 ,
4
4
"host" : " localhost" ,
5
5
"debug" : false ,
6
+ "themeSource" : " dark" ,
6
7
"appName" : " RedisInsight" ,
7
8
"schema" : " redisinsight" ,
8
9
"mainWindow" : {
Original file line number Diff line number Diff line change 1
1
import { app , ipcMain , nativeTheme } from 'electron'
2
2
import { electronStore } from 'desktopSrc/lib'
3
- import { IpcInvokeEvent } from 'uiSrc/electron/constants'
3
+ import { ElectronStorageItem , IpcInvokeEvent } from 'uiSrc/electron/constants'
4
4
5
5
export const initIPCHandlers = ( ) => {
6
6
ipcMain . handle ( IpcInvokeEvent . getAppVersion , ( ) => app ?. getVersion ( ) )
@@ -10,6 +10,9 @@ export const initIPCHandlers = () => {
10
10
ipcMain . handle ( IpcInvokeEvent . deleteStoreValue , ( _event , key ) => electronStore ?. delete ( key ) )
11
11
12
12
ipcMain . handle ( IpcInvokeEvent . themeChange , ( _event , theme : string ) => {
13
- nativeTheme . themeSource = theme . toLowerCase ( )
13
+ const themeSource = theme . toLowerCase ( ) as typeof nativeTheme . themeSource
14
+
15
+ nativeTheme . themeSource = themeSource
16
+ electronStore ?. set ( ElectronStorageItem . themeSource , themeSource )
14
17
} )
15
18
}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ enum ElectronStorageItem {
6
6
isDisplayAppInTray = 'isDisplayAppInTray' ,
7
7
updatePreviousVersion = 'updatePreviousVersion' ,
8
8
zoomFactor = 'zoomFactor' ,
9
+ themeSource = 'themeSource' ,
9
10
}
10
11
11
12
export default ElectronStorageItem
You can’t perform that action at this time.
0 commit comments