MCPcopy Index your code
hub / github.com/vercel/hyper / GetWindow

Function GetWindow

app/index.ts:215–226  ·  view source on GitHub ↗

* Get last focused BrowserWindow or create new if none and callback * @param callback Function to call with the BrowserWindow

(callback: (win: BrowserWindow) => void)

Source from the content-addressed store, hash-verified

213 * @param callback Function to call with the BrowserWindow
214 */
215function GetWindow(callback: (win: BrowserWindow) => void) {
216 const lastWindow = app.getLastFocusedWindow();
217 if (lastWindow) {
218 callback(lastWindow);
219 } else if (!lastWindow && {}.hasOwnProperty.call(app, 'createWindow')) {
220 app.createWindow(callback);
221 } else {
222 // If createWindow doesn't exist yet ('ready' event was not fired),
223 // sets his callback to an app.windowCallback property.
224 app.windowCallback = callback;
225 }
226}
227
228app.on('open-file', (_event, path) => {
229 GetWindow((win: BrowserWindow) => {

Callers 1

index.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected