Skip to content

Commit 0e9f299

Browse files
authored
Fix open new empty window and duplicate windows (#638)
1 parent a9050f4 commit 0e9f299

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

js/main.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ function BlackboxLogViewer() {
129129
'min_height' : INNER_BOUNDS_HEIGHT,
130130
},
131131
function (createdWindow) {
132-
if (fileToOpen !== undefined) {
133-
createdWindow.window.argv = fileToOpen;
134-
}
132+
createdWindow.window.argv = fileToOpen;
135133
});
136134

137135
}
@@ -2111,10 +2109,10 @@ function BlackboxLogViewer() {
21112109
// so we limit it to one of them, the first in the list for example
21122110
const windows = chrome.app.window.getAll();
21132111

2114-
const firstWindowId = windows[0].id;
2115-
const currentWindowId = chrome.app.window.current().id;
2112+
const firstWindow = windows[0];
2113+
const currentWindow = chrome.app.window.current();
21162114

2117-
if (currentWindowId === firstWindowId) {
2115+
if (currentWindow === firstWindow) {
21182116

21192117
const filePathToOpenExpression = /.*"([^"]*)"$/;
21202118
const fileToOpen = path.match(filePathToOpenExpression);

0 commit comments

Comments
 (0)