electron-window-state icon indicating copy to clipboard operation
electron-window-state copied to clipboard

Suggestion: saving the open/close state

Open warpdesign opened this issue 6 years ago • 0 comments

Use case: an app may have opened different windows which the user may close.

When re-launching the app, only windows that were opened when the app exited should be re-opened.

Having an additional property isOpen (that defaults to true) in the window state would fix the problem. Closing a specific window would set state.isOpen to false.

Code like this could be used:

const userListState = windowStateKeeper({
    file: 'userList'
  });

// only open userList window if it was previously opened
if (userListSate.isOpen) {
    const userListWindow = new BrowserWindow();
    // ...
 }

warpdesign avatar May 06 '19 08:05 warpdesign