diff --git a/index/index.js b/index/index.js index 92d4f9a..e1f219b 100644 --- a/index/index.js +++ b/index/index.js @@ -37,8 +37,8 @@ const background = async () => { window.addEventListener("unload", async () => { await Promise.all([ - nativeWindow.destroy({ ref: asideMainWin }), - nativeWindow.destroy({ ref: spotlightWin }), + nativeWindow.destroy(asideMainWin), + nativeWindow.destroy(spotlightWin), ]); }); }; @@ -55,36 +55,30 @@ const createWindowView = async (action, win, args) => { const loadViewURL = async (win, view, { url, action }) => { if (action === "addBrowserView") { - await nativeWindow.addBrowserView({ ref: win, viewRef: view }); + await nativeWindow.addBrowserView(win, view); } else { - await nativeWindow.setBrowserView({ ref: win, viewRef: view }); + await nativeWindow.setBrowserView(win, view); } - const viewContents = await views.getWebContents({ ref: view }); - await webContents.loadURL({ ref: viewContents }, url); + const viewContents = await views.getWebContents(view); + await webContents.loadURL(viewContents, url); }; const setViewBounds = async (win, view, { x, y, w, h }) => { - const [currWidth, currHeight] = await nativeWindow.getSize({ ref: win }); - - await views.setBounds({ - ref: view, - bounds: { - x: Math.round(currWidth * x), - y: Math.round(currHeight * y), - width: Math.round(currWidth * w), - height: Math.round(currHeight * h), - }, + const [currWidth, currHeight] = await nativeWindow.getSize(win); + + await views.setBounds(view, { + x: Math.round(currWidth * x), + y: Math.round(currHeight * y), + width: Math.round(currWidth * w), + height: Math.round(currHeight * h), }); - await views.setAutoResize({ - ref: view, - dimensions: { - width: true, - height: true, - horizontal: true, - vertical: true, - }, + await views.setAutoResize(view, { + width: true, + height: true, + horizontal: true, + vertical: true, }); }; @@ -106,12 +100,9 @@ subscribe("workspace:selected", async ({ title }) => { partition: `memory:${title}`, }); - await nativeWindow.setTitle({ ref: spotlightWin, title }); + await nativeWindow.setTitle(spotlightWin, title); if (selectedWorkspace) { - await nativeWindow.removeBrowserView({ - ref: asideMainWin, - viewRef: selectedWorkspace, - }); + await nativeWindow.removeBrowserView(asideMainWin, selectedWorkspace); } selectedWorkspace = await createWindowView("addBrowserView", asideMainWin, {