new: add exit dialog when press close button
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'dart:io';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/features/connection/notifier/connection_notifier.dart';
|
||||
import 'package:hiddify/utils/utils.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
@@ -45,11 +47,7 @@ class WindowNotifier extends _$WindowNotifier with AppLogger {
|
||||
}
|
||||
|
||||
Future<void> quit() async {
|
||||
await ref
|
||||
.read(connectionNotifierProvider.notifier)
|
||||
.abortConnection()
|
||||
.timeout(const Duration(seconds: 2))
|
||||
.catchError(
|
||||
await ref.read(connectionNotifierProvider.notifier).abortConnection().timeout(const Duration(seconds: 2)).catchError(
|
||||
(e) {
|
||||
loggy.warning("error aborting connection on quit", e);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user