diff --git a/koordinates/gui/explore_tab_bar.py b/koordinates/gui/explore_tab_bar.py index 793df08..cf71d07 100644 --- a/koordinates/gui/explore_tab_bar.py +++ b/koordinates/gui/explore_tab_bar.py @@ -225,6 +225,14 @@ def _explore_sections_retrieved(self, sections: List[ExploreSection]): if sip.isdeleted(self): return + # clear out old explore section tabs + for i in range(self.count()-1, -1, -1): + if self.tabData(i) not in ( + StandardExploreModes.Browse, + StandardExploreModes.Publishers + ): + self.removeTab(i) + for section in sections: if section.slug == 'popular': # special case for popular, should always be first tab diff --git a/koordinates/gui/filter_widget.py b/koordinates/gui/filter_widget.py index 5c63a7a..4927858 100644 --- a/koordinates/gui/filter_widget.py +++ b/koordinates/gui/filter_widget.py @@ -148,6 +148,12 @@ def _explore_sections_retrieved(self, sections: List[ExploreSection]): if sip.isdeleted(self): return + # clear out old explore section tabs + for button in self.explore_buttons: + self.explore_buttons_layout.removeWidget(button) + button.deleteLater() + self.explore_buttons = [] + default_section = None for section in sections: