show info dialog when reconnecting
This commit is contained in:
@@ -322,7 +322,7 @@
|
||||
"experimentalNotice": "Experimental Features In Use",
|
||||
"experimentalNoticeMsg": "You've enabled some experimental features which might affect connection quality and cause unexpected errors. You can always change or reset these options from Config options page.",
|
||||
"disableExperimentalNotice": "Don't Show Again",
|
||||
"reconnectMsg": "Reconnect for Changes to Take Effect"
|
||||
"reconnectMsg": "Reconnecting for taking into account the changes..."
|
||||
},
|
||||
"config": {
|
||||
"resetBtn": "Reset Options",
|
||||
|
||||
@@ -322,7 +322,7 @@
|
||||
"experimentalNotice": "ویژگیهای آزمایشی در حال استفاده",
|
||||
"experimentalNoticeMsg": "شما برخی از ویژگیهای آزمایشی را فعال کردهاید که ممکن است بر کیفیت اتصال تأثیر گذاشته و باعث بروز خطاهای غیرمنتظره شود. شما همیشه میتوانید این گزینهها را از صفحهی تنظیمات پیکربندی تغییر دهید یا بازنشانی کنید.",
|
||||
"disableExperimentalNotice": "دیگر نشان نده",
|
||||
"reconnectMsg": "دوباره متصل شوید تا تغییرات اعمال شوند"
|
||||
"reconnectMsg": "در حال اتصال مجدد برای اعمال تغییرات..."
|
||||
},
|
||||
"config": {
|
||||
"resetBtn": "بازنشانی تنظیمات",
|
||||
|
||||
@@ -13,12 +13,10 @@ class ConnectionWrapper extends StatefulHookConsumerWidget {
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
ConsumerState<ConsumerStatefulWidget> createState() =>
|
||||
_ConnectionWrapperState();
|
||||
ConsumerState<ConsumerStatefulWidget> createState() => _ConnectionWrapperState();
|
||||
}
|
||||
|
||||
class _ConnectionWrapperState extends ConsumerState<ConnectionWrapper>
|
||||
with AppLogger {
|
||||
class _ConnectionWrapperState extends ConsumerState<ConnectionWrapper> with AppLogger {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ref.listen(connectionNotifierProvider, (_, __) {});
|
||||
@@ -26,16 +24,16 @@ class _ConnectionWrapperState extends ConsumerState<ConnectionWrapper>
|
||||
ref.listen(configOptionNotifierProvider, (previous, next) async {
|
||||
if (next case AsyncData(value: true)) {
|
||||
final t = ref.read(translationsProvider);
|
||||
ref.watch(inAppNotificationControllerProvider).showInfoToast(
|
||||
t.connection.reconnectMsg,
|
||||
// actionText: t.connection.reconnect,
|
||||
// callback: () async {
|
||||
// await ref
|
||||
// .read(connectionNotifierProvider.notifier)
|
||||
// .reconnect(await ref.read(activeProfileProvider.future));
|
||||
// },
|
||||
);
|
||||
await ref.read(connectionNotifierProvider.notifier).reconnect(await ref.read(activeProfileProvider.future));
|
||||
// ref.watch(inAppNotificationControllerProvider).showActionToast(
|
||||
// t.connection.reconnectMsg,
|
||||
// actionText: t.connection.reconnect,
|
||||
// callback: () async {
|
||||
// await ref
|
||||
// .read(connectionNotifierProvider.notifier)
|
||||
// .reconnect(await ref.read(activeProfileProvider.future));
|
||||
// },
|
||||
// );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user