File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import { Downloader } from "@shared";
44import { levelKeys , db } from "./level" ;
55import type { UserPreferences } from "@types" ;
66import {
7- WSClient ,
87 SystemPath ,
98 CommonRedistManager ,
109 TorBoxClient ,
@@ -47,7 +46,7 @@ export const loadState = async () => {
4746
4847 await HydraApi . setupApi ( ) . then ( ( ) => {
4948 uploadGamesBatch ( ) ;
50- WSClient . connect ( ) ;
49+ // WSClient.connect();
5150 } ) ;
5251
5352 const downloads = await downloadsSublevel
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import { getUserData } from "./user/get-user-data";
1111import { db } from "@main/level" ;
1212import { levelKeys } from "@main/level/sublevels" ;
1313import type { Auth , User } from "@types" ;
14- import { WSClient } from "./ws/ws-client" ;
1514
1615interface HydraApiOptions {
1716 needsAuth ?: boolean ;
@@ -103,8 +102,8 @@ export class HydraApi {
103102 WindowManager . mainWindow . webContents . send ( "on-signin" ) ;
104103 await clearGamesRemoteIds ( ) ;
105104 uploadGamesBatch ( ) ;
106- WSClient . close ( ) ;
107- WSClient . connect ( ) ;
105+ // WSClient.close();
106+ // WSClient.connect();
108107 }
109108 }
110109
Original file line number Diff line number Diff line change @@ -181,16 +181,21 @@ export class WindowManager {
181181 } ) ;
182182
183183 this . mainWindow . on ( "close" , async ( ) => {
184+ const mainWindow = this . mainWindow ;
185+ this . mainWindow = null ;
186+
184187 const userPreferences = await db . get < string , UserPreferences > (
185188 levelKeys . userPreferences ,
186189 {
187190 valueEncoding : "json" ,
188191 }
189192 ) ;
190193
191- if ( this . mainWindow ) {
192- const lastBounds = this . mainWindow . getBounds ( ) ;
193- const isMaximized = this . mainWindow . isMaximized ( ) ?? false ;
194+ if ( mainWindow ) {
195+ mainWindow . setProgressBar ( - 1 ) ;
196+
197+ const lastBounds = mainWindow . getBounds ( ) ;
198+ const isMaximized = mainWindow . isMaximized ( ) ?? false ;
194199 const screenConfig = isMaximized
195200 ? {
196201 x : undefined ,
@@ -207,9 +212,6 @@ export class WindowManager {
207212 if ( userPreferences ?. preferQuitInsteadOfHiding ) {
208213 app . quit ( ) ;
209214 }
210-
211- WindowManager . mainWindow ?. setProgressBar ( - 1 ) ;
212- WindowManager . mainWindow = null ;
213215 } ) ;
214216
215217 this . mainWindow . webContents . setWindowOpenHandler ( ( handler ) => {
You can’t perform that action at this time.
0 commit comments