diff --git a/podcasts-gtk/src/app.rs b/podcasts-gtk/src/app.rs index 0c6623e..4806a39 100644 --- a/podcasts-gtk/src/app.rs +++ b/podcasts-gtk/src/app.rs @@ -349,8 +349,24 @@ impl App { let menu = &s.get().container; self.headerbar.set_secondary_menu(menu); } - Action::EmptyState => self.content.switch_to_empty_views(), - Action::PopulatedState => self.content.switch_to_populated(), + Action::EmptyState => { + self.window + .lookup_action("refresh") + .and_then(|action| action.downcast::().ok()) + // Disable refresh action + .map(|action| action.set_enabled(false)); + + self.content.switch_to_empty_views(); + } + Action::PopulatedState => { + self.window + .lookup_action("refresh") + .and_then(|action| action.downcast::().ok()) + // Enable refresh action + .map(|action| action.set_enabled(true)); + + self.content.switch_to_populated(); + } } }