Reconnect automatically after changing service-mode
This commit is contained in:
@@ -23,18 +23,19 @@ class _ConnectionWrapperState extends ConsumerState<ConnectionWrapper>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
ref.listen(connectionNotifierProvider, (_, __) {});
|
ref.listen(connectionNotifierProvider, (_, __) {});
|
||||||
|
|
||||||
ref.listen(configOptionNotifierProvider, (previous, next) {
|
ref.listen(configOptionNotifierProvider, (previous, next) async {
|
||||||
if (next case AsyncData(value: true)) {
|
if (next case AsyncData(value: true)) {
|
||||||
final t = ref.read(translationsProvider);
|
final t = ref.read(translationsProvider);
|
||||||
ref.watch(inAppNotificationControllerProvider).showActionToast(
|
await ref.read(connectionNotifierProvider.notifier).reconnect(await ref.read(activeProfileProvider.future));
|
||||||
t.connection.reconnectMsg,
|
// ref.watch(inAppNotificationControllerProvider).showActionToast(
|
||||||
actionText: t.connection.reconnect,
|
// t.connection.reconnectMsg,
|
||||||
callback: () async {
|
// actionText: t.connection.reconnect,
|
||||||
await ref
|
// callback: () async {
|
||||||
.read(connectionNotifierProvider.notifier)
|
// await ref
|
||||||
.reconnect(await ref.read(activeProfileProvider.future));
|
// .read(connectionNotifierProvider.notifier)
|
||||||
},
|
// .reconnect(await ref.read(activeProfileProvider.future));
|
||||||
);
|
// },
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user