mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-28 00:35:32 +08:00
fix: enforce OMO ↔ OMO Slim cross-category mutual exclusion
When activating an OMO provider, deactivate all OMO Slim providers in the same transaction and delete the Slim config file, and vice versa. This prevents both plugin variants from being active simultaneously.
This commit is contained in:
@@ -513,6 +513,8 @@ impl ProviderService {
|
||||
state,
|
||||
&crate::services::omo::STANDARD,
|
||||
)?;
|
||||
// OMO ↔ OMO Slim mutually exclusive: remove Slim config
|
||||
let _ = crate::services::OmoService::delete_config_file(&crate::services::omo::SLIM);
|
||||
return Ok(SwitchResult::default());
|
||||
}
|
||||
|
||||
@@ -522,6 +524,10 @@ impl ProviderService {
|
||||
.db
|
||||
.set_omo_provider_current(app_type.as_str(), id, "omo-slim")?;
|
||||
crate::services::OmoService::write_config_to_file(state, &crate::services::omo::SLIM)?;
|
||||
// OMO ↔ OMO Slim mutually exclusive: remove Standard config
|
||||
let _ = crate::services::OmoService::delete_config_file(
|
||||
&crate::services::omo::STANDARD,
|
||||
);
|
||||
return Ok(SwitchResult::default());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user