mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-24 06:48:38 +02:00
CW-1091-payjoin-error-handeling (#2317)
* feat: stop polling payjoin on switch wallet * refactor: improve Payjoin session handling and cleanup unused methods - Replaced `initReceiver` with `getUnusedReceiver` to reuse existing Payjoin sessions. - Streamlined session initialization by removing `spawnNewReceiver`. - Adjusted wallet sync reactions to resume Payjoin sessions when necessary. * fix: Receiver.fromJson correctly handle parameter format in Payjoin manager * fix: try reloading unspents if unspents are empty; No Unpsents available are now recoverable errors * fix: ensure transaction details display only if transactionInfo is available and adjust payjoin success status handling * fix: adjust payjoin success status handling for pending transactions * fix: add error handling for Payjoin initialization and receiver creation [skip-ci] * fix: add unrecoverable error handling for Payjoin sender sessions
This commit is contained in:
@@ -20,9 +20,8 @@ class PayjoinTransactionListItem extends ActionListItem {
|
||||
String get status {
|
||||
switch (session.status) {
|
||||
case 'success':
|
||||
if (transaction?.isPending == true)
|
||||
return S.current.payjoin_request_awaiting_tx;
|
||||
return S.current.successful;
|
||||
if (transaction?.isPending == false) return S.current.successful;
|
||||
return S.current.payjoin_request_awaiting_tx;
|
||||
case 'inProgress':
|
||||
return S.current.payjoin_request_in_progress;
|
||||
case 'unrecoverable':
|
||||
|
||||
@@ -69,7 +69,7 @@ abstract class PayjoinDetailsViewModelBase with Store {
|
||||
title: S.current.error,
|
||||
value: payjoinSession.error!,
|
||||
),
|
||||
if (payjoinSession.txId?.isNotEmpty == true)
|
||||
if (payjoinSession.txId?.isNotEmpty == true && transactionInfo != null)
|
||||
StandartListItem(
|
||||
title: S.current.transaction_details_transaction_id,
|
||||
value: payjoinSession.txId!,
|
||||
@@ -107,9 +107,8 @@ abstract class PayjoinDetailsViewModelBase with Store {
|
||||
String _getStatusString() {
|
||||
switch (payjoinSession.status) {
|
||||
case 'success':
|
||||
if (transactionInfo?.isPending == true)
|
||||
return S.current.payjoin_request_awaiting_tx;
|
||||
return S.current.successful;
|
||||
if (transactionInfo?.isPending == false) return S.current.successful;
|
||||
return S.current.payjoin_request_awaiting_tx;
|
||||
case 'inProgress':
|
||||
return S.current.payjoin_request_in_progress;
|
||||
case 'unrecoverable':
|
||||
|
||||
Reference in New Issue
Block a user