Skip to content

Commit

Permalink
fix: only open playcover app when using playtools (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc authored Dec 13, 2023
1 parent 4b88288 commit cf914ec
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions maa-cli/src/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub use roguelike::{roguelike, Theme as RoguelikeTheme};

use crate::{
config::{
asst::{with_asst_config, with_mut_asst_config, AsstConfig},
asst::{with_asst_config, with_mut_asst_config, AsstConfig, ConnectionConfig},
task::TaskConfig,
},
consts::MAA_CORE_LIB,
Expand Down Expand Up @@ -132,7 +132,13 @@ where
asst.append_task(task_type, serde_json::to_string(params)?)?;
}

let playcover = PlayCoverApp::from(&task_config);
let playcover = with_asst_config(|config| {
if matches!(config.connection, ConnectionConfig::PlayTools { .. }) {
PlayCoverApp::from(&task_config)
} else {
None
}
});

if let Some(app) = playcover.as_ref() {
app.open()?;
Expand Down

0 comments on commit cf914ec

Please sign in to comment.