Add reconnect alert for config options
This commit is contained in:
@@ -16,6 +16,8 @@ import 'package:hiddify/utils/utils.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
abstract interface class ConnectionRepository {
|
||||
SingboxConfigOption? get configOptionsSnapshot;
|
||||
|
||||
TaskEither<ConnectionFailure, Unit> setup();
|
||||
Stream<ConnectionStatus> watchConnectionStatus();
|
||||
TaskEither<ConnectionFailure, Unit> connect(
|
||||
@@ -50,6 +52,10 @@ class ConnectionRepositoryImpl
|
||||
final ProfilePathResolver profilePathResolver;
|
||||
final GeoAssetPathResolver geoAssetPathResolver;
|
||||
|
||||
SingboxConfigOption? _configOptionsSnapshot;
|
||||
@override
|
||||
SingboxConfigOption? get configOptionsSnapshot => _configOptionsSnapshot;
|
||||
|
||||
bool _initialized = false;
|
||||
|
||||
@override
|
||||
@@ -112,6 +118,7 @@ class ConnectionRepositoryImpl
|
||||
) {
|
||||
return exceptionHandler(
|
||||
() {
|
||||
_configOptionsSnapshot = options;
|
||||
return singbox
|
||||
.changeOptions(options)
|
||||
.mapLeft(InvalidConfigOption.new)
|
||||
|
||||
Reference in New Issue
Block a user