Skip to content

Commit

Permalink
Fix status bar flashing state when log console is created.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongrout committed Oct 17, 2019
1 parent 2105a18 commit 49667fb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/logconsole-extension/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,11 @@ function activateLogConsole(
switch (msg.type) {
case 'after-show':
case 'after-attach':
if (logConsolePanel.isVisible) {
status.model.markSourceLogsViewed(status.model.source);
// Because we are running in a message hook,
// logConsolePanel.isVisible hasn't been updated yet, so we figure
// out visibility based on the parent logConsoleWidget's visibility.
if (logConsoleWidget.isVisible) {
status.model.markSourceLogsViewed(logConsolePanel.source);
status.model.flashEnabled = false;
}
break;
Expand All @@ -175,7 +178,10 @@ function activateLogConsole(
return true;
});

logConsolePanel.sourceChanged.connect(() => {
logConsolePanel.sourceChanged.connect(panel => {
if (panel.isVisible && panel.source) {
status.model.markSourceLogsViewed(panel.source);
}
app.commands.notifyCommandChanged();
});

Expand Down

0 comments on commit 49667fb

Please sign in to comment.