File tree Expand file tree Collapse file tree 9 files changed +21
-15
lines changed
Expand file tree Collapse file tree 9 files changed +21
-15
lines changed Original file line number Diff line number Diff line change 11LOCALHOST_ELECTRON_SERVER_PORT = " 8844"
2- BASE_REST_API = " https://localhost:10000 "
2+ BASE_REST_API = " https://gp-api-w36p.onrender.com "
Original file line number Diff line number Diff line change 1- BASE_REST_API = " https://gp-api-w36p.onrender.com"
2- GH_TOKEN = " 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"
1+ BASE_REST_API = " https://gp-api-w36p.onrender.com"
Original file line number Diff line number Diff line change @@ -71,11 +71,10 @@ export class AppWindow implements TWindowManager {
7171
7272 private async checkAuthenticated ( window : BrowserWindow ) {
7373 const result = this . authService . checkAuthenticated ( window ) ;
74- if ( result !== undefined && result . isAuthenticated !== undefined ) {
75- ipcWebContentsSend ( "authSocialNetwork" , window . webContents , {
76- isAuthenticated : result . isAuthenticated ,
77- } ) ;
78- }
74+ ipcWebContentsSend ( "authSocialNetwork" , window . webContents , {
75+ isAuthenticated :
76+ result !== undefined && result . isAuthenticated !== undefined ,
77+ } ) ;
7978 }
8079
8180 private buildTray ( window : BrowserWindow ) : void {
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import { TWindowManager } from "../../@core/types/window-manager.js";
55 hash : "window/resource/add" ,
66 isCache : true ,
77 options : {
8- alwaysOnTop : true ,
98 width : 400 ,
109 height : 500 ,
1110 } ,
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { TWindowManager } from "../../@core/types/window-manager.js";
66 hash : "window/resource/delete" ,
77 isCache : true ,
88 options : {
9- alwaysOnTop : true ,
109 width : 350 ,
1110 height : 190 ,
1211 } ,
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { TWindowManager } from "../../@core/types/window-manager.js";
66 hash : "window/resource/update" ,
77 isCache : true ,
88 options : {
9- alwaysOnTop : true ,
109 width : 400 ,
1110 height : 500 ,
1211 } ,
Original file line number Diff line number Diff line change 11import { useEffect } from "react" ;
2+ import { useLocation } from "react-router-dom" ;
3+
4+ export const useClosePreloadWindow = ( currentPathname : string ) => {
5+ const { pathname } = useLocation ( ) ;
26
3- export const useClosePreloadWindow = ( ) => {
47 useEffect ( ( ) => {
5- window . electron . send . closePreloadWindow ( ) ;
6- } , [ ] ) ;
8+ const normalizedParam = currentPathname . startsWith ( "/" )
9+ ? currentPathname
10+ : `/${ currentPathname } ` ;
11+
12+ if ( normalizedParam === pathname ) {
13+ window . electron . send . closePreloadWindow ( ) ;
14+ }
15+ } , [ currentPathname , pathname ] ) ;
716} ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const theme = createTheme({
2828} ) ;
2929
3030export const MainLayout = ( ) => {
31- useClosePreloadWindow ( ) ;
31+ useClosePreloadWindow ( "sign-in" ) ;
3232
3333 return (
3434 < ThemeProvider theme = { theme } >
Original file line number Diff line number Diff line change @@ -7,11 +7,13 @@ import {
77} from "@ui-business/MasterKey" ;
88import { Provider as ProviderSync } from "@ui-business/Sync" ;
99import { LoadingSpinner } from "@components/LoadingSpinner" ;
10+ import { useClosePreloadWindow } from "@hooks/closePreloadWindow" ;
1011
1112const LazyTopPanel = lazy ( ( ) => import ( "./TopPanel" ) ) ;
1213const LazyResources = lazy ( ( ) => import ( "./Resources" ) ) ;
1314
1415const Home = ( ) => {
16+ useClosePreloadWindow ( "window:main" ) ;
1517 useIpcMasterKey ( ) ;
1618 const { isMasterKey } = useControlContextMasterKey ( ) ;
1719
You can’t perform that action at this time.
0 commit comments