Browse Source

fix(bluetooth_manager): 在配对页面时不跳转至配对路由

添加对当前路由是否为配对页面的检查,防止在已处于配对页面时重复跳转
weicu
lxm 1 year ago
parent
commit
b528038c2b
  1. 4
      lib/data/services/bluetooth_manager.dart

4
lib/data/services/bluetooth_manager.dart

@ -76,7 +76,9 @@ class BluetoothManager extends GetxService {
currentDeviceRx.value = newDevice;
// 检查当前是否在OTA升级界面,如果是则不跳转
if (!_isInOtaUpgradePage() && !_bleManager.isConnected) {
if (!_isInOtaUpgradePage() &&
!_bleManager.isConnected &&
Get.currentRoute != Routes.pairing) {
Get.toNamed(Routes.pairing, arguments: newDevice);
} else {
Logger.info('当前在OTA升级界面,跳过配对页面跳转');

Loading…
Cancel
Save