Commit 23e3ab2d170ce818bce91c801578f625da9fc9f2

Authored by 权海
1 parent 6810f127

feat(ui):先应用主题, 后向watch传输

... ... @@ -227,25 +227,20 @@ class CustomWatchThemePreviewController extends GetxController {
}
}
var syncSuccess = true;
var syncSuccess = false;
try {
final success = await WearEngineHostApi().syncWatchTheme(downloadedTheme);
if (success) {
final result = await _themeApi.applyTheme(themeId);
if (result is! AppSuccess<void>) {
syncSuccess = await WearEngineHostApi().syncWatchTheme(downloadedTheme);
isApplying.value = false;
AppToast.show(l10n.watchThemeApplyFailed);
return false;
}
syncSuccess = success;
}
selectedThemeItem.value = themeItem;
isApplying.value = false;
return true;
}
syncSuccess = success;
return true;
} catch (_) {
// The active theme is already saved on the server.
syncSuccess = false;
}
isApplying.value = false;
if (!syncSuccess) {
... ...
... ... @@ -198,22 +198,18 @@ class WatchThemePreviewController extends GetxController {
}
}
var syncSuccess = true;
var syncSuccess = false;
try {
final success = await WearEngineHostApi().syncWatchTheme(downloadedTheme);
if (success) {
final result = await _themeApi.applyTheme(themeId);
if (result is! AppSuccess<void>) {
syncSuccess = await WearEngineHostApi().syncWatchTheme(downloadedTheme);
isApplying.value = false;
AppToast.show(l10n.watchThemeApplyFailed);
return false;
}
syncSuccess = success;
}
selectedThemeItem.value = themeItem;
isApplying.value = false;
return true;
}
syncSuccess = success;
return true;
} catch (_) {
// The active theme is already saved on the server.
syncSuccess = false;
... ...