From 88b13d1681c6668f5696060d484fb6578c286663 Mon Sep 17 00:00:00 2001 From: Guocork Date: Thu, 7 Nov 2024 14:59:57 +0800 Subject: [PATCH] refactor PopupAction --- src/app.rs | 2 +- src/shared/download_notification_popup.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app.rs b/src/app.rs index 86d4418b..05c0256d 100644 --- a/src/app.rs +++ b/src/app.rs @@ -233,7 +233,7 @@ impl MatchEvent for App { chat_radio_button.select(cx, &mut Scope::empty()); } - if let PopupAction::NavigateToMyModels = action.as_widget_action().cast() { + if let PopupAction::NavigateToMyModels = action.cast() { let my_models_radio_button = self.ui.radio_button(id!(my_models_tab)); my_models_radio_button.select(cx, &mut Scope::empty()); } diff --git a/src/shared/download_notification_popup.rs b/src/shared/download_notification_popup.rs index 3c9e986d..96c6231d 100644 --- a/src/shared/download_notification_popup.rs +++ b/src/shared/download_notification_popup.rs @@ -258,7 +258,7 @@ impl WidgetMatchEvent for DownloadNotificationPopup { .clicked(actions) { // TODO: Abstract the navigation actions on a single enum for the whole app. - cx.widget_action(widget_uid, &scope.path, PopupAction::NavigateToMyModels); + cx.action(PopupAction::NavigateToMyModels); cx.widget_action(widget_uid, &scope.path, DownloadNotificationPopupAction::ActionLinkClicked); }