|
@@ -227,25 +227,20 @@ class CustomWatchThemePreviewController extends GetxController { |
|
@@ -227,25 +227,20 @@ class CustomWatchThemePreviewController extends GetxController { |
|
227
|
}
|
227
|
}
|
|
228
|
}
|
228
|
}
|
|
229
|
|
229
|
|
|
230
|
- var syncSuccess = true;
|
230
|
+ var syncSuccess = false;
|
|
231
|
try {
|
231
|
try {
|
|
232
|
- final success = await WearEngineHostApi().syncWatchTheme(downloadedTheme);
|
|
|
|
233
|
- if (success) {
|
|
|
|
234
|
final result = await _themeApi.applyTheme(themeId);
|
232
|
final result = await _themeApi.applyTheme(themeId);
|
|
235
|
if (result is! AppSuccess<void>) {
|
233
|
if (result is! AppSuccess<void>) {
|
|
|
|
234
|
+ syncSuccess = await WearEngineHostApi().syncWatchTheme(downloadedTheme);
|
|
236
|
isApplying.value = false;
|
235
|
isApplying.value = false;
|
|
237
|
AppToast.show(l10n.watchThemeApplyFailed);
|
236
|
AppToast.show(l10n.watchThemeApplyFailed);
|
|
238
|
return false;
|
237
|
return false;
|
|
239
|
- }
|
|
|
|
240
|
- syncSuccess = success;
|
238
|
+ }
|
|
241
|
selectedThemeItem.value = themeItem;
|
239
|
selectedThemeItem.value = themeItem;
|
|
242
|
isApplying.value = false;
|
240
|
isApplying.value = false;
|
|
243
|
- return true;
|
|
|
|
244
|
- }
|
|
|
|
245
|
- syncSuccess = success;
|
241
|
+ return true;
|
|
246
|
} catch (_) {
|
242
|
} catch (_) {
|
|
247
|
// The active theme is already saved on the server.
|
243
|
// The active theme is already saved on the server.
|
|
248
|
- syncSuccess = false;
|
|
|
|
249
|
}
|
244
|
}
|
|
250
|
isApplying.value = false;
|
245
|
isApplying.value = false;
|
|
251
|
if (!syncSuccess) {
|
246
|
if (!syncSuccess) {
|