|
...
|
...
|
@@ -257,14 +257,14 @@ class TodayController extends GetMaterialController { |
|
|
|
bool success = await _hostApi.requestHealthClientAuthorization();
|
|
|
|
AppLogger.d("requestHealthClientAuthorization : $success");
|
|
|
|
if (success) {
|
|
|
|
await LoadingService.instance.run(() async {
|
|
|
|
try {
|
|
|
|
final result = await _hostApi.performHealthUpload();
|
|
|
|
} catch (error, stackTrace) {
|
|
|
|
AppLogger.e('Apple Health upload failed', error, stackTrace);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
result.status = 1;
|
|
|
|
// await LoadingService.instance.run(() async {
|
|
|
|
try {
|
|
|
|
final result = _hostApi.performHealthUpload();
|
|
|
|
} catch (error, stackTrace) {
|
|
|
|
AppLogger.e('Apple Health upload failed', error, stackTrace);
|
|
|
|
}
|
|
|
|
// });
|
|
|
|
// result.status = 1;
|
|
|
|
// AppToast.show('刷新完成');
|
|
|
|
if (isFromNoPermissionPage) {
|
|
|
|
Get.back();
|
|
...
|
...
|
@@ -276,13 +276,13 @@ class TodayController extends GetMaterialController { |
|
|
|
}
|
|
|
|
return;
|
|
|
|
} else if (result.status == 1) {
|
|
|
|
await LoadingService.instance.run(() async {
|
|
|
|
try {
|
|
|
|
final result = await _hostApi.performHealthUpload();
|
|
|
|
} catch (error, stackTrace) {
|
|
|
|
AppLogger.e('Apple Health upload failed', error, stackTrace);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
// await LoadingService.instance.run(() async {
|
|
|
|
try {
|
|
|
|
final result = _hostApi.performHealthUpload();
|
|
|
|
} catch (error, stackTrace) {
|
|
|
|
AppLogger.e('Apple Health upload failed', error, stackTrace);
|
|
|
|
}
|
|
|
|
// });
|
|
|
|
if (isFromNoPermissionPage) {
|
|
|
|
Get.back();
|
|
|
|
}
|
...
|
...
|
|