Skip to content

Commit adf1bc8

Browse files
Merge pull request #1256 from cypherstack/julian/fixes
Julian/fixes
2 parents ba10bff + 4faa262 commit adf1bc8

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

lib/app_config.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ abstract class AppConfig {
8585

8686
try {
8787
return coins.firstWhere(
88-
(e) => e.identifier.toLowerCase() == name || e.prettyName == prettyName,
88+
(e) =>
89+
e.identifier.toLowerCase() == name ||
90+
e.prettyName == prettyName ||
91+
(e is Epiccash && prettyName == "Epic Private Internet Cash"),
8992
);
9093
} catch (_) {
9194
throw Exception("getCryptoCurrencyByPrettyName($prettyName) failed!");

lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'dart:async';
12
import 'dart:convert';
23
import 'dart:isolate';
34
import 'dart:math';
@@ -66,7 +67,18 @@ abstract class _SparkIsolate {
6667
static SendPort? _sendPort;
6768
static final ReceivePort _receivePort = ReceivePort();
6869

70+
static Completer<void>? completer;
71+
6972
static Future<void> initialize() async {
73+
if (completer != null) {
74+
if (!completer!.isCompleted) {
75+
await completer!.future;
76+
}
77+
78+
return;
79+
}
80+
completer = Completer();
81+
7082
final level = Prefs.instance.logLevel;
7183

7284
_isolate = await Isolate.spawn((SendPort sendPort) {
@@ -88,6 +100,7 @@ abstract class _SparkIsolate {
88100
});
89101
}, _receivePort.sendPort);
90102
_sendPort = await _receivePort.first as SendPort;
103+
completer!.complete();
91104
}
92105

93106
static Future<R> run<M, R>(ComputeCallback<M, R> task, M argument) async {

0 commit comments

Comments
 (0)