Fix bugs
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import 'package:dartx/dartx.dart';
|
||||
import 'package:hiddify/core/prefs/general_prefs.dart';
|
||||
import 'package:hiddify/features/common/app_update_notifier.dart';
|
||||
import 'package:hiddify/features/common/connectivity/connectivity_controller.dart';
|
||||
@@ -20,8 +19,7 @@ void commonControllers(CommonControllersRef ref) {
|
||||
introCompletedProvider,
|
||||
(_, completed) async {
|
||||
if (completed) {
|
||||
await Future.delayed(5.seconds)
|
||||
.then((_) async => ref.read(cronServiceProvider).startScheduler());
|
||||
await ref.read(cronServiceProvider).startScheduler();
|
||||
}
|
||||
},
|
||||
fireImmediately: true,
|
||||
|
||||
@@ -7,23 +7,30 @@ import 'package:hiddify/utils/utils.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
// TODO add release notes
|
||||
class NewVersionDialog extends HookConsumerWidget {
|
||||
const NewVersionDialog(
|
||||
class NewVersionDialog extends HookConsumerWidget with PresLogger {
|
||||
NewVersionDialog(
|
||||
this.currentVersion,
|
||||
this.newVersion, {
|
||||
super.key,
|
||||
// super.key,
|
||||
this.canIgnore = true,
|
||||
});
|
||||
}) : super(key: _dialogKey);
|
||||
|
||||
final String currentVersion;
|
||||
final RemoteVersionInfo newVersion;
|
||||
final bool canIgnore;
|
||||
|
||||
Future<void> show(BuildContext context) {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => this,
|
||||
);
|
||||
static final _dialogKey = GlobalKey(debugLabel: 'new version dialog');
|
||||
|
||||
Future<void> show(BuildContext context) async {
|
||||
if (_dialogKey.currentContext == null) {
|
||||
return showDialog(
|
||||
context: context,
|
||||
useRootNavigator: true,
|
||||
builder: (context) => this,
|
||||
);
|
||||
} else {
|
||||
loggy.warning("new version dialog is already open");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -32,7 +32,7 @@ class ProfileTile extends HookConsumerWidget {
|
||||
|
||||
final selectActiveMutation = useMutation(
|
||||
initialOnFailure: (err) {
|
||||
CustomToast.error(t.printError(err)).show(context);
|
||||
CustomToast.error(t.presentShortError(err)).show(context);
|
||||
},
|
||||
initialOnSuccess: () {
|
||||
if (context.mounted) context.pop();
|
||||
|
||||
Reference in New Issue
Block a user