()
| 380 | } |
| 381 | |
| 382 | const createWindow = (): void => { |
| 383 | if (isRestorePathway) { |
| 384 | // We will restore based off the previous buffer, one window per buffer store file |
| 385 | const bufferStores = editorBufferStore.getAll() |
| 386 | const bufferStoreList = Object.values(bufferStores) as Array<{ |
| 387 | id: string |
| 388 | filePath: string | null |
| 389 | }> |
| 390 | if (bufferStoreList.length === 0) { |
| 391 | this._createEditorWindow() |
| 392 | return |
| 393 | } |
| 394 | |
| 395 | bufferStoreList.forEach((bufferStoreInfo) => { |
| 396 | // Read the buffer store file and pass the content |
| 397 | this._createEditorWindow(null, [], [], {}, bufferStoreInfo) |
| 398 | }) |
| 399 | } else if (_openFilesCache.length) { |
| 400 | // We should wipe the buffer store if not it will keep creating new windows whenever we open files via double click in the file manager |
| 401 | editorBufferStore.clearBufferStoresWithAllSaved() |
| 402 | this._openFilesToOpen() |
| 403 | } else { |
| 404 | this._createEditorWindow() |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | if (isLinux) { |
| 409 | let windowCreated = false |
nothing calls this directly
no test coverage detected