Fix profile update bug
This commit is contained in:
@@ -84,12 +84,20 @@ class FFISingboxService
|
||||
}
|
||||
|
||||
@override
|
||||
TaskEither<String, Unit> parseConfig(String path) {
|
||||
TaskEither<String, Unit> parseConfig(
|
||||
String path,
|
||||
String tempPath,
|
||||
bool debug,
|
||||
) {
|
||||
return TaskEither(
|
||||
() => CombineWorker().execute(
|
||||
() {
|
||||
final err = _box
|
||||
.parse(path.toNativeUtf8().cast())
|
||||
.parse(
|
||||
path.toNativeUtf8().cast(),
|
||||
tempPath.toNativeUtf8().cast(),
|
||||
debug ? 1 : 0,
|
||||
)
|
||||
.cast<Utf8>()
|
||||
.toDartString();
|
||||
if (err.isNotEmpty) {
|
||||
|
||||
@@ -42,12 +42,16 @@ class MobileSingboxService
|
||||
TaskEither.of(unit);
|
||||
|
||||
@override
|
||||
TaskEither<String, Unit> parseConfig(String path) {
|
||||
TaskEither<String, Unit> parseConfig(
|
||||
String path,
|
||||
String tempPath,
|
||||
bool debug,
|
||||
) {
|
||||
return TaskEither(
|
||||
() async {
|
||||
final message = await _methodChannel.invokeMethod<String>(
|
||||
"parse_config",
|
||||
{"path": path},
|
||||
{"path": path, "tempPath": tempPath, "debug": debug},
|
||||
);
|
||||
if (message == null || message.isEmpty) return right(unit);
|
||||
return left(message);
|
||||
|
||||
@@ -24,7 +24,11 @@ abstract interface class SingboxService {
|
||||
String tempDir,
|
||||
);
|
||||
|
||||
TaskEither<String, Unit> parseConfig(String path);
|
||||
TaskEither<String, Unit> parseConfig(
|
||||
String path,
|
||||
String tempPath,
|
||||
bool debug,
|
||||
);
|
||||
|
||||
TaskEither<String, Unit> changeConfigOptions(ConfigOptions options);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user