diff --git a/lib/ui/dashboard/dashboard_screen.dart b/lib/ui/dashboard/dashboard_screen.dart index 3cc1f6d1d..5d42d0b39 100644 --- a/lib/ui/dashboard/dashboard_screen.dart +++ b/lib/ui/dashboard/dashboard_screen.dart @@ -267,27 +267,32 @@ class _DashboardScreenState extends State child: IconButton( tooltip: localization!.enableReactApp, onPressed: () async { - final credentials = state.credentials; - final account = state.account - .rebuild((b) => b..setReactAsDefaultAP = true); - final url = '${credentials.url}/accounts/${account.id}'; - final data = serializers.serializeWith( - AccountEntity.serializer, account); + confirmCallback( + context: context, + message: localization.enableReactApp, + callback: (_) { + final credentials = state.credentials; + final account = state.account + .rebuild((b) => b..setReactAsDefaultAP = true); + final url = '${credentials.url}/accounts/${account.id}'; + final data = serializers.serializeWith( + AccountEntity.serializer, account); - store.dispatch(StartSaving()); - WebClient() - .put( - url, - credentials.token, - data: json.encode(data), - ) - .then((dynamic _) { - store.dispatch(StopSaving()); - WebUtils.reloadBrowser(); - }).catchError((Object error) { - store.dispatch(StopSaving()); - showErrorDialog(message: error as String?); - }); + store.dispatch(StartSaving()); + WebClient() + .put( + url, + credentials.token, + data: json.encode(data), + ) + .then((dynamic _) { + store.dispatch(StopSaving()); + WebUtils.reloadBrowser(); + }).catchError((Object error) { + store.dispatch(StopSaving()); + showErrorDialog(message: error as String?); + }); + }); }, icon: Icon(MdiIcons.react), ),