fix: skip spawning listener if Dart stream is already closed

This commit is contained in:
Forte11Cuba
2026-03-29 15:22:23 -06:00
parent 7d5efcfb75
commit c92c438efe
+10 -5
View File
@@ -331,11 +331,16 @@ impl Wallet {
mint_url,
} = handle;
let _ = sink.add(NostrPaymentEvent {
state: NostrPaymentState::Waiting,
amount: None,
error: None,
});
if sink
.add(NostrPaymentEvent {
state: NostrPaymentState::Waiting,
amount: None,
error: None,
})
.is_err()
{
return Ok(());
}
let _self = self.clone();
flutter_rust_bridge::spawn(async move {