Skip to content

Commit

Permalink
Ignore onTabUpdated events for unknown tabs
Browse files Browse the repository at this point in the history
Fixes #237
  • Loading branch information
cxw42 committed Dec 25, 2020
1 parent 89c7341 commit f779c3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/settings/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ recovered window will show up in TabFern as a separate, unsaved window
listed in the title bar. This will make it easier to reference the
commit in bug reports. ${issue(210)}</li>
<li>Fix broken image links in README.md. Thanks, @bluikko! ${issue(224)}</li>
<li>Misc: ${issue([233, 236], true)}</li>
<li>Misc: ${issue([233, 236, 237], true)}</li>
` +
'</ul>'
),
Expand Down
6 changes: 5 additions & 1 deletion app/win/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,11 @@ me.react_onTabUpdated = function(ctabid, changeinfo, newctab) {
let should_refresh_icon = false;

let tabvn = me.vn_by_cid(ctabid, K.IT_TAB);
if(!tabvn.val) return `Tab ${ctabid} not found`;
if(!tabvn.val) {
// We've probably already closed this tab, so drop this change (#237).
log.info(`Ignoring tabUpdated event for unknown tab ${ctabid}`);
return {dirty: false};
}

let node = T.treeobj.get_node(tabvn.node_id);
if(!node) return `No node for ID ${tabvn.node_id} (${JSON.stringify(tabvn)})`;
Expand Down

0 comments on commit f779c3e

Please sign in to comment.