This commit is contained in:
problematicconsumer
2023-10-04 18:06:48 +03:30
parent 839967d02d
commit 8ec9f7f964
25 changed files with 130 additions and 89 deletions

View File

@@ -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,

View File

@@ -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

View File

@@ -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();