Skip to content

Commit 05b6657

Browse files
committed
Always show a detail panel tab
Previously when the user deselected the current tab in the popup, no detail panel tab content was shown. With this change, there always will be a visible tab.
1 parent 49988e4 commit 05b6657

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/components/detail_panel.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,15 @@ export default class DetailPanel {
422422
}
423423

424424
get currentTab() {
425-
return this.devTool.options.detailPanel.currentTab
425+
const options = this.devTool.options
426+
427+
const storedCurrentTab = options.detailPanel.currentTab
428+
const currentTabIsVisible = this.tabs.map((tab) => tab.id).includes(storedCurrentTab)
429+
if (currentTabIsVisible) return storedCurrentTab
430+
431+
const newCurrentTab = this.tabs[0].id
432+
options.detailPanel.currentTab = newCurrentTab
433+
this.devTool.saveOptions(options)
434+
return newCurrentTab
426435
}
427436
}

0 commit comments

Comments
 (0)