diff --git a/lib/app_config.dart b/lib/app_config.dart index ab5d1da28..e1790ee27 100644 --- a/lib/app_config.dart +++ b/lib/app_config.dart @@ -85,7 +85,10 @@ abstract class AppConfig { try { return coins.firstWhere( - (e) => e.identifier.toLowerCase() == name || e.prettyName == prettyName, + (e) => + e.identifier.toLowerCase() == name || + e.prettyName == prettyName || + (e is Epiccash && prettyName == "Epic Private Internet Cash"), ); } catch (_) { throw Exception("getCryptoCurrencyByPrettyName($prettyName) failed!"); diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart index ecf7c94a5..f3729b2ae 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:convert'; import 'dart:isolate'; import 'dart:math'; @@ -66,7 +67,18 @@ abstract class _SparkIsolate { static SendPort? _sendPort; static final ReceivePort _receivePort = ReceivePort(); + static Completer? completer; + static Future initialize() async { + if (completer != null) { + if (!completer!.isCompleted) { + await completer!.future; + } + + return; + } + completer = Completer(); + final level = Prefs.instance.logLevel; _isolate = await Isolate.spawn((SendPort sendPort) { @@ -88,6 +100,7 @@ abstract class _SparkIsolate { }); }, _receivePort.sendPort); _sendPort = await _receivePort.first as SendPort; + completer!.complete(); } static Future run(ComputeCallback task, M argument) async {