From 272f4ef0168315bf066e34f9a26ee6d4e701285a Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Thu, 16 Mar 2023 10:00:09 +0100 Subject: [PATCH] fix(dtmm): Prevent logging from causing state changes The log view itself still works correctly, as it is lensed onto the field. But ignoring log from general Data comparisons prevents it generating state changes. This also removes the log for unknown commands. In practice, missing to implement a command hasn't been an issue. --- crates/dtmm/src/state/data.rs | 2 ++ crates/dtmm/src/state/delegate.rs | 7 +------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/dtmm/src/state/data.rs b/crates/dtmm/src/state/data.rs index 37d66e7..3f63a2a 100644 --- a/crates/dtmm/src/state/data.rs +++ b/crates/dtmm/src/state/data.rs @@ -155,6 +155,8 @@ pub(crate) struct State { pub game_dir: Arc, pub data_dir: Arc, pub nexus_api_key: Arc, + + #[data(ignore)] pub log: Arc, #[lens(ignore)] diff --git a/crates/dtmm/src/state/delegate.rs b/crates/dtmm/src/state/delegate.rs index 4a0fc17..33a2136 100644 --- a/crates/dtmm/src/state/delegate.rs +++ b/crates/dtmm/src/state/delegate.rs @@ -354,12 +354,7 @@ impl AppDelegate for Delegate { state.is_update_in_progress = false; Handled::Yes } - cmd => { - if cfg!(debug_assertions) { - tracing::warn!("Unknown command: {:?}", cmd); - } - Handled::No - } + _ => Handled::No, } } -- 2.45.3