Refactoring the way a selected sub is opened

This commit is contained in:
Théo Piboubès
2015-08-12 14:39:49 +02:00
parent a02322d5fe
commit 691986abd4
3 changed files with 15 additions and 7 deletions

View File

@@ -167,9 +167,15 @@ class SubredditPage(BasePage):
show_notification(self.stdscr, ['Not logged in'])
return
# Open subscriptions page
page = SubscriptionPage(self.stdscr, self.reddit)
page.loop()
# When user has chosen a subreddit in the subscriptions list, refresh content with the selected subreddit
chosen_subreddit = page.get_selected_subreddit_data()
if chosen_subreddit is not None:
self.refresh_content(name=chosen_subreddit['name'])
@staticmethod
def draw_item(win, data, inverted=False):