refactor: do not include cache in message

We already have access to the cache in the `update` arguments.
This commit is contained in:
Michael Mallan 2025-01-10 17:01:37 +00:00
parent 665c527dd0
commit 130d004e79
No known key found for this signature in database
GPG Key ID: 5177CDCEDB0EABEB
4 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ use crate::{
pub enum Message {
Tick,
UpdateCache(Result<Cache, Error>),
UpdatePanelCache(/* is current panel */ bool, Result<Cache, Error>),
UpdatePanelCache(/* is current panel */ bool),
View(view::Message),
LoadDaemonConfig(Box<DaemonConfig>),
DaemonConfigLoaded(Result<(), Error>),

View File

@ -327,7 +327,7 @@ impl App {
panel.update(
daemon.clone(),
&cache,
Message::UpdatePanelCache(current == menu, Ok(cache.clone())),
Message::UpdatePanelCache(current == menu),
)
})
.collect();

View File

@ -254,7 +254,7 @@ impl State for Home {
}
}
},
Message::UpdatePanelCache(is_current, Ok(cache)) => {
Message::UpdatePanelCache(is_current) => {
let wallet_was_syncing = !self.sync_status.is_synced();
self.sync_status = sync_status(
daemon.backend(),

View File

@ -136,7 +136,7 @@ impl State for BitcoindSettingsState {
self.rescan_settings.past_possible_height = true;
self.rescan_settings.processing = false;
}
Message::UpdatePanelCache(_, Ok(_)) => {
Message::UpdatePanelCache(_) => {
self.rescan_settings.processing = cache.rescan_progress.is_some_and(|p| p < 1.0);
}
Message::View(view::Message::Settings(view::SettingsMessage::BitcoindSettings(