feat: fallback to General config

This commit is contained in:
Horror Proton
2024-08-02 13:32:51 +08:00
parent 271985fcb4
commit 837c5bc04a
2 changed files with 14 additions and 0 deletions

View File

@@ -705,7 +705,11 @@ bool asst::AdbController::connect(
{ "why", "ConfigNotFound" },
};
callback(AsstMsg::ConnectionInfo, info);
#ifdef ASST_DEBUG
return false;
#endif
Log.error("config ", config, "not found");
adb_ret = Config.get_adb_cfg("General");
}
const auto& adb_cfg = adb_ret.value();

View File

@@ -368,7 +368,17 @@ bool asst::MinitouchController::connect(const std::string& adb_path, const std::
auto adb_ret = Config.get_adb_cfg(config);
if (!adb_ret) {
json::value info = get_info_json()
| json::object {
{ "what", "ConnectFailed" },
{ "why", "ConfigNotFound" },
};
callback(AsstMsg::ConnectionInfo, info);
#ifdef ASST_DEBUG
return false;
#endif
Log.error("config ", config, "not found");
adb_ret = Config.get_adb_cfg("General");
}
const auto& adb_cfg = adb_ret.value();