Skip to content

Commit

Permalink
Fix crash on multiple carousel screens overlapping and using back fea…
Browse files Browse the repository at this point in the history
…ture. Order of carousels are now proper.
  • Loading branch information
freQniK committed Jun 24, 2024
1 parent 61a5a7e commit aa5f215
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/ui/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -1891,8 +1891,14 @@ def add_rv_data(self, node):

def set_previous_screen(self):
mw = Meile.app.root.get_screen(WindowNames.MAIN_WINDOW)
mw.carousel.remove_widget(mw.NodeWidget)
mw.carousel.load_previous()
try:
while len(mw.carousel.slides) > 1:
mw.carousel.remove_widget(mw.carousel.slides[-1])
except Exception as e:
print(str(e))
pass

mw.carousel.load_slide(mw.carousel.slides[0])

class PlanScreen(MDBoxLayout):
def __init__(self, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion src/ui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ def switch_carousel(self):
mw = Meile.app.root.get_screen(WindowNames.MAIN_WINDOW)
mw.clear_node_carousel()
mw.carousel.remove_widget(self)
mw.carousel.load_slide(mw.NodeWidget)
mw.carousel.load_slide(mw.carousel.slides[-1])

def closeDialogReturnToSubscriptions(self,inst):
self.dialog.dismiss()
Expand Down

0 comments on commit aa5f215

Please sign in to comment.