File tree Expand file tree Collapse file tree 6 files changed +14
-11
lines changed Expand file tree Collapse file tree 6 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import { env } from "@follow/shared/env"
5
5
import { imageRefererMatches , selfRefererMatches } from "@follow/shared/image"
6
6
import { parse } from "cookie-es"
7
7
import { app , BrowserWindow , session } from "electron"
8
- import type { Cookie } from "electron/main"
9
8
import squirrelStartup from "electron-squirrel-startup"
10
9
11
10
import { DEVICE_ID } from "./constants/system"
@@ -77,7 +76,7 @@ function bootstrap() {
77
76
mainWindow = createMainWindow ( )
78
77
79
78
// restore cookies
80
- const cookies = store . get ( "cookies" ) as Cookie [ ]
79
+ const cookies = store . get ( "cookies" )
81
80
if ( cookies ) {
82
81
Promise . all (
83
82
cookies . map ( ( cookie ) => {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export const setProxyConfig = (inputProxy: string) => {
25
25
}
26
26
27
27
export const getProxyConfig = ( ) => {
28
- const proxyConfig = store . get ( "proxy" ) as string | undefined
28
+ const proxyConfig = store . get ( "proxy" )
29
29
if ( ! proxyConfig ) {
30
30
return
31
31
}
Original file line number Diff line number Diff line change 1
1
import type { Credentials } from "@eneris/push-receiver/dist/types"
2
+ import type { Cookie } from "electron"
2
3
import Store from "electron-store"
3
4
4
5
// @keep -sorted
@@ -8,8 +9,16 @@ type StoreData = {
8
9
appearance ?: "light" | "dark" | "system" | null
9
10
betterAuthSessionCookie ?: string | null
10
11
cacheSizeLimit ?: number | null
12
+ cookies ?: Cookie [ ] | null
13
+ minimizeToTray ?: boolean | null
11
14
proxy ?: string | null
12
15
user ?: string | null
16
+ windowState ?: {
17
+ height : number
18
+ width : number
19
+ x : number
20
+ y : number
21
+ } | null
13
22
}
14
23
export const store = new Store < StoreData > ( { name : "db" } )
15
24
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ const destroyAppTray = () => {
54
54
55
55
const DEFAULT_MINIMIZE_TO_TRAY = isMacOS ? false : true
56
56
57
- export const getTrayConfig = ( ) : boolean => store . get ( "minimizeToTray" ) ?? DEFAULT_MINIMIZE_TO_TRAY
57
+ export const getTrayConfig = ( ) => store . get ( "minimizeToTray" ) ?? DEFAULT_MINIMIZE_TO_TRAY
58
58
59
59
export const setTrayConfig = ( input : boolean ) => {
60
60
store . set ( "minimizeToTray" , input )
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { store } from "./store"
8
8
9
9
const BetterAuthKey = "betterAuthSessionCookie"
10
10
export const setBetterAuthSessionCookie = ( cookie : string ) => store . set ( BetterAuthKey , cookie )
11
- export const getBetterAuthSessionCookie = ( ) : string | null => store . get ( BetterAuthKey ) || null
11
+ export const getBetterAuthSessionCookie = ( ) => store . get ( BetterAuthKey )
12
12
export const cleanBetterAuthSessionCookie = ( ) => store . set ( BetterAuthKey , null )
13
13
14
14
const UserKey = "user"
Original file line number Diff line number Diff line change @@ -222,12 +222,7 @@ export function createWindow(
222
222
}
223
223
export const windowStateStoreKey = "windowState"
224
224
export const createMainWindow = ( ) => {
225
- const windowState = store . get ( windowStateStoreKey ) as {
226
- height : number
227
- width : number
228
- x : number
229
- y : number
230
- } | null
225
+ const windowState = store . get ( windowStateStoreKey )
231
226
const primaryDisplay = screen . getPrimaryDisplay ( )
232
227
const { workArea } = primaryDisplay
233
228
You can’t perform that action at this time.
0 commit comments