fix:修复删除设备,设备列表没有刷新

This commit is contained in:
anfe 2024-06-04 15:09:22 +08:00
parent f1fd311bf5
commit f44c86a512

View File

@ -509,6 +509,7 @@ class LockSetLogic extends BaseGetXController {
// //
StreamSubscription? _passCurrentLockInformationEvent; StreamSubscription? _passCurrentLockInformationEvent;
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) { void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
// eventBus // eventBus
_passCurrentLockInformationEvent = eventBus _passCurrentLockInformationEvent = eventBus
@ -567,18 +568,19 @@ class LockSetLogic extends BaseGetXController {
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
BlueManage().connectDeviceMacAddress = ''; BlueManage().connectDeviceMacAddress = '';
final bool isXHJ = F.isXHJ;
final bool isOnlyOneData = state.isOnlyOneData.value == true;
await Future<dynamic>.delayed(const Duration(milliseconds: 200))
.then((e) {
if (isXHJ) {
Get.close(3);
} else {
Get.close(isOnlyOneData ? 1 : 2);
}
});
SchedulerBinding.instance.addPostFrameCallback((_) { SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
}); });
if (state.isOnlyOneData.value == true) {
Future<dynamic>.delayed(const Duration(milliseconds: 200)).then((e) {
Get.close(1);
});
} else {
Future<dynamic>.delayed(const Duration(milliseconds: 200)).then((e) {
Get.close(2);
});
}
} }
} }
@ -591,12 +593,10 @@ class LockSetLogic extends BaseGetXController {
state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0); state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
BlueManage().connectDeviceMacAddress = ''; BlueManage().connectDeviceMacAddress = '';
SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent());
});
final bool isXHJ = F.isXHJ; final bool isXHJ = F.isXHJ;
final bool isOnlyOneData = state.isOnlyOneData.value == true; final bool isOnlyOneData = state.isOnlyOneData.value == true;
Future<dynamic>.delayed(const Duration(milliseconds: 200)).then((e) { await Future<dynamic>.delayed(const Duration(milliseconds: 200)).then((e) {
if (isXHJ) { if (isXHJ) {
Get.close(3); Get.close(3);
} else { } else {
@ -604,6 +604,9 @@ class LockSetLogic extends BaseGetXController {
Get.close(onlyOneDataInt); Get.close(onlyOneDataInt);
} }
}); });
SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent());
});
} }
} }