MCPcopy Index your code
hub / github.com/CopyTranslator/CopyTranslator / loadRoute

Function loadRoute

src/main/views/utils.ts:13–34  ·  view source on GitHub ↗
(
  window: BrowserWindow,
  routeName: RouteActionType,
  main: boolean,
  queryString: string
)

Source from the content-addressed store, hash-verified

11}
12
13export 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
36export interface MinimalParam {
37 x: number;

Callers 1

createWindowMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected