💄 Optimize connection experience
This commit is contained in:
parent
8e0e2dacfe
commit
b9461e5019
@ -55,6 +55,8 @@ class ChatProvider extends ChangeNotifier {
|
|||||||
if (!noRetry) {
|
if (!noRetry) {
|
||||||
await auth.client!.refreshToken(auth.client!.currentRefreshToken!);
|
await auth.client!.refreshToken(auth.client!.currentRefreshToken!);
|
||||||
connect(auth, noRetry: true);
|
connect(auth, noRetry: true);
|
||||||
|
} else {
|
||||||
|
rethrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +95,8 @@ class NotifyProvider extends ChangeNotifier {
|
|||||||
if (!noRetry) {
|
if (!noRetry) {
|
||||||
await auth.client!.refreshToken(auth.client!.currentRefreshToken!);
|
await auth.client!.refreshToken(auth.client!.currentRefreshToken!);
|
||||||
connect(auth, noRetry: true);
|
connect(auth, noRetry: true);
|
||||||
|
} else {
|
||||||
|
rethrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import 'package:solian/providers/chat.dart';
|
|||||||
import 'package:solian/providers/keypair.dart';
|
import 'package:solian/providers/keypair.dart';
|
||||||
import 'package:solian/providers/notify.dart';
|
import 'package:solian/providers/notify.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
import 'package:solian/widgets/exts.dart';
|
||||||
|
|
||||||
class ProviderInitializer extends StatefulWidget {
|
class ProviderInitializer extends StatefulWidget {
|
||||||
final Widget child;
|
final Widget child;
|
||||||
@ -29,6 +30,7 @@ class _ProviderInitializerState extends State<ProviderInitializer> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
if (await auth.isAuthorized()) {
|
if (await auth.isAuthorized()) {
|
||||||
if (auth.client == null) {
|
if (auth.client == null) {
|
||||||
await auth.loadClient();
|
await auth.loadClient();
|
||||||
@ -42,6 +44,9 @@ class _ProviderInitializerState extends State<ProviderInitializer> {
|
|||||||
onKexProvide: keypair.receiveKeypair,
|
onKexProvide: keypair.receiveKeypair,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
context.showErrorDialog(e);
|
||||||
|
}
|
||||||
|
|
||||||
notify.close();
|
notify.close();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user