electron-window-state
electron-window-state copied to clipboard
Suggestion: saving the open/close state
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();
// ...
}