| 11 | } |
| 12 | |
| 13 | export function loadRoute( |
| 14 | window: BrowserWindow, |
| 15 | routeName: RouteActionType, |
| 16 | main: boolean, |
| 17 | queryString: string |
| 18 | ) { |
| 19 | if (process.env.WEBPACK_DEV_SERVER_URL) { |
| 20 | // Load the url of the dev server if in development mode |
| 21 | const url = env.publicUrl + `/#/${routeName}${queryString}`; |
| 22 | console.log(url); |
| 23 | window.loadURL(url); |
| 24 | |
| 25 | if (!process.env.IS_TEST && main) window.webContents.openDevTools(); |
| 26 | } else { |
| 27 | // Load the index.html when not in development |
| 28 | if (main) { |
| 29 | createProtocol("app"); |
| 30 | } |
| 31 | const url = `${env.publicUrl}/index.html#${routeName}${queryString}`; |
| 32 | window.loadURL(url); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | export interface MinimalParam { |
| 37 | x: number; |