minor fixes

This commit is contained in:
OmarHatem
2026-03-24 02:52:06 +01:00
parent a864655e2d
commit 079fb1a028
2 changed files with 6 additions and 4 deletions
@@ -43,9 +43,9 @@ class LightningWallet {
void _subscribeToLogStream(File logFile) {
_logSubscription = _logStream?.listen((logEntry) {
logFile.writeAsString("[${logEntry.level}] ${logEntry.line}\n", mode: FileMode.append);
logFile.writeAsStringSync("[${logEntry.level}] ${logEntry.line}\n", mode: FileMode.append);
}, onError: (e) {
logFile.writeAsString("[ERROR] $e\n", mode: FileMode.append);
logFile.writeAsStringSync("[ERROR] $e\n", mode: FileMode.append);
});
}
@@ -146,13 +146,15 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo
}
if (!fiatConversionStore.prices.containsKey(cryptoCurrency)) return "";
return (double.parse(_amount) * fiatConversionStore.prices[cryptoCurrency]!).toStringAsFixed(2);
final amount = double.tryParse(_amount) ?? 0;
return (amount * fiatConversionStore.prices[cryptoCurrency]!).toStringAsFixed(2);
}
@computed
String get selectedCurrencyFiatAmount {
if (_fiatRate == null) return "";
return (double.parse(_amount) * _fiatRate!).toStringAsFixed(2);
final amount = double.tryParse(_amount) ?? 0;
return (amount * _fiatRate!).toStringAsFixed(2);
}
@action