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.
This commit is contained in:
Lucas Schwiderski 2023-03-16 10:00:09 +01:00
parent 8705c3b9ac
commit 272f4ef016
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8
2 changed files with 3 additions and 6 deletions

View file

@ -155,6 +155,8 @@ pub(crate) struct State {
pub game_dir: Arc<PathBuf>,
pub data_dir: Arc<PathBuf>,
pub nexus_api_key: Arc<String>,
#[data(ignore)]
pub log: Arc<String>,
#[lens(ignore)]

View file

@ -354,12 +354,7 @@ impl AppDelegate<State> for Delegate {
state.is_update_in_progress = false;
Handled::Yes
}
cmd => {
if cfg!(debug_assertions) {
tracing::warn!("Unknown command: {:?}", cmd);
}
Handled::No
}
_ => Handled::No,
}
}