fix: refresh button actually refreshes

This commit is contained in:
Gabriele Musco 2023-08-29 15:35:29 +00:00
commit 6ab2a1a22e

View file

@ -57,7 +57,7 @@ pub enum MainViewMsg {
SetSelectedProfile(u32), SetSelectedProfile(u32),
ProfileSelected(u32), ProfileSelected(u32),
UpdateSelectedProfile(Profile), UpdateSelectedProfile(Profile),
TickSelectedProfileTracker, MarkChanged,
EditProfile, EditProfile,
CreateProfile, CreateProfile,
DeleteProfile, DeleteProfile,
@ -382,7 +382,7 @@ impl SimpleComponent for MainView {
set_halign: gtk::Align::Start, set_halign: gtk::Align::Start,
set_label: "Refresh", set_label: "Refresh",
connect_clicked[sender] => move |_| { connect_clicked[sender] => move |_| {
sender.input(Self::Input::TickSelectedProfileTracker); sender.input(Self::Input::MarkChanged);
} }
}, },
}, },
@ -559,8 +559,8 @@ impl SimpleComponent for MainView {
.sender() .sender()
.emit(InstallWivrnBoxMsg::UpdateSelectedProfile(prof.clone())); .emit(InstallWivrnBoxMsg::UpdateSelectedProfile(prof.clone()));
} }
Self::Input::TickSelectedProfileTracker => { Self::Input::MarkChanged => {
self.set_selected_profile(self.selected_profile.clone()); self.mark_all_changed();
} }
Self::Input::UpdateProfiles(profiles, config) => { Self::Input::UpdateProfiles(profiles, config) => {
self.set_profiles(profiles); self.set_profiles(profiles);