MCPcopy Create free account
hub / github.com/DeepNotesApp/DeepNotes / createWindow

Function createWindow

apps/client/src-electron/electron-main.ts:63–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61}
62
63function createWindow() {
64 /**
65 * Initial window options
66 */
67 mainWindow = new BrowserWindow({
68 icon: path.resolve(__dirname, 'icons/icon.png'), // tray icon
69 width: 1000,
70 height: 600,
71 useContentSize: true,
72 webPreferences: {
73 contextIsolation: true,
74 // More info: https://v2.quasar.dev/quasar-cli-vite/developing-electron-apps/electron-preload-script
75 preload: path.resolve(__dirname, process.env.QUASAR_ELECTRON_PRELOAD),
76 devTools: !!process.env.DEBUGGING,
77 },
78 show: false,
79 });
80
81 mainWindow.maximize();
82 mainWindow.show();
83
84 mainWindow.loadURL(process.env.APP_URL);
85
86 if (!process.env.DEBUGGING) {
87 mainWindow.setMenuBarVisibility(false);
88 }
89
90 mainWindow.webContents.setWindowOpenHandler((details) => {
91 shell.openExternal(details.url);
92 return { action: 'deny' };
93 });
94
95 mainWindow.on('closed', () => {
96 mainWindow = undefined;
97 });
98
99 // Helpers
100
101 function setValue(obj: any, key: string, value: any) {
102 const lowerCaseKey = key.toLowerCase();
103
104 for (const key of Object.keys(obj)) {
105 if (key.toLowerCase() === lowerCaseKey) {
106 obj[key] = value;
107 return;
108 }
109 }
110
111 obj[key] = value;
112 }
113
114 function getValue(obj: any, key: string): string | undefined {
115 const lowerCaseKey = key.toLowerCase();
116
117 for (const key of Object.keys(obj)) {
118 if (key.toLowerCase() === lowerCaseKey) {
119 return obj[key];
120 }

Callers 1

electron-main.tsFile · 0.85

Calls 6

setValueFunction · 0.85
getValueFunction · 0.85
catchMethod · 0.80
thenMethod · 0.80
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected