Commit 8e5a26f198faaa08dcabe517f9ef8e23d5ef3e10

Authored by 权海
1 parent af9130ed

feat(ui):增加设置主题成功后通知watch刷新

... ... @@ -191,26 +191,27 @@ class WatchThemePreviewController extends GetxController {
}
}
var syncSuccess = false;
try {
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;
}
final syncSuccess =
await WearEngineHostApi().syncWatchTheme(downloadedTheme);
if (!syncSuccess) {
AppToast.show(l10n.watchThemeWatchSyncFailed);
return false;
}
selectedThemeItem.value = themeItem;
isApplying.value = false;
return true;
} catch (_) {
// The active theme is already saved on the server.
syncSuccess = false;
}
isApplying.value = false;
if (!syncSuccess) {
AppToast.show(l10n.watchThemeWatchSyncFailed);
AppToast.show(l10n.watchThemeApplyFailed);
return false;
} finally {
isApplying.value = false;
}
return syncSuccess;
}
}
... ...