mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-01-11 22:40:36 +00:00
refactor: update message handling in GetIsolateService to use listen instead of for loop
This commit is contained in:
parent
6a099415db
commit
1d81906c4f
1 changed files with 3 additions and 4 deletions
|
|
@ -91,8 +91,7 @@ class GetIsolateService {
|
|||
)
|
||||
.run(() async {
|
||||
isolateData.sendPort.send(receivePort.sendPort);
|
||||
|
||||
await for (var message in receivePort) {
|
||||
receivePort.listen((message) async {
|
||||
if (message is Map<String, dynamic>) {
|
||||
try {
|
||||
final url = message['url'] as String?;
|
||||
|
|
@ -150,9 +149,9 @@ class GetIsolateService {
|
|||
}
|
||||
useLogger = false;
|
||||
} else if (message == 'dispose') {
|
||||
break;
|
||||
receivePort.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue