Commit 42e1231ace038af3cf1e77ca9f6972a97e42f545

Authored by 权海
1 parent 77d971c0

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

... ... @@ -190,27 +190,27 @@ class WatchThemePreviewController extends GetxController {
}
}
var syncSuccess = false;
try {
final result = await _themeApi.applyTheme(themeId);
if (result is! AppSuccess<void>) {
syncSuccess =
await AppWearEngineHostApi().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;
}
}
... ...