mirror of
https://github.com/jwinterm/grim.git
synced 2026-11-24 06:43:54 +01:00
fix: tx ui on repost
This commit is contained in:
@@ -175,24 +175,26 @@ impl WalletTransactions {
|
||||
});
|
||||
}
|
||||
|
||||
let rebroadcast = tx.broadcasting_timed_out(wallet);
|
||||
if !tx.cancelled() && !tx.cancelling() && !tx.posting() {
|
||||
let rebroadcast = tx.broadcasting_timed_out(wallet);
|
||||
|
||||
// Draw button to cancel transaction.
|
||||
if tx.can_cancel() || rebroadcast {
|
||||
let (icon, color) = (PROHIBIT, Some(Colors::red()));
|
||||
View::item_button(ui, CornerRadius::default(), icon, color, || {
|
||||
self.confirm_cancel_tx_id = Some(tx.data.id);
|
||||
// Show transaction cancellation confirmation modal.
|
||||
Modal::new(CANCEL_TX_CONFIRMATION_MODAL)
|
||||
.position(ModalPosition::Center)
|
||||
.title(t!("confirmation"))
|
||||
.show();
|
||||
});
|
||||
}
|
||||
|
||||
// Draw button to repeat transaction action.
|
||||
if tx.can_repeat_action() || rebroadcast {
|
||||
Self::tx_repeat_button_ui(ui, CornerRadius::default(), tx, wallet, rebroadcast);
|
||||
// Draw button to cancel transaction.
|
||||
if tx.can_cancel() || rebroadcast {
|
||||
let (icon, color) = (PROHIBIT, Some(Colors::red()));
|
||||
View::item_button(ui, CornerRadius::default(), icon, color, || {
|
||||
self.confirm_cancel_tx_id = Some(tx.data.id);
|
||||
// Show transaction cancellation confirmation modal.
|
||||
Modal::new(CANCEL_TX_CONFIRMATION_MODAL)
|
||||
.position(ModalPosition::Center)
|
||||
.title(t!("confirmation"))
|
||||
.show();
|
||||
});
|
||||
}
|
||||
|
||||
// Draw button to repeat transaction action.
|
||||
if tx.can_repeat_action() || rebroadcast {
|
||||
Self::tx_repeat_button_ui(ui, CornerRadius::default(), tx, wallet, rebroadcast);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -258,29 +258,31 @@ impl WalletTransactionContent {
|
||||
});
|
||||
}
|
||||
|
||||
let rebroadcast = tx.broadcasting_timed_out(&wallet);
|
||||
if !tx.cancelled() && !tx.cancelling() && !tx.posting() {
|
||||
let rebroadcast = tx.broadcasting_timed_out(&wallet);
|
||||
|
||||
// Draw button to cancel transaction.
|
||||
if tx.can_cancel() || rebroadcast {
|
||||
let r = if tx.can_finalize() {
|
||||
CornerRadius::default()
|
||||
} else {
|
||||
View::item_rounding(0, 2, true)
|
||||
};
|
||||
View::item_button(ui, r, PROHIBIT, Some(Colors::red()), || {
|
||||
wallet.task(WalletTask::Cancel(tx.clone()));
|
||||
Modal::close();
|
||||
});
|
||||
}
|
||||
// Draw button to cancel transaction.
|
||||
if tx.can_cancel() || rebroadcast {
|
||||
let r = if tx.can_finalize() {
|
||||
CornerRadius::default()
|
||||
} else {
|
||||
View::item_rounding(0, 2, true)
|
||||
};
|
||||
View::item_button(ui, r, PROHIBIT, Some(Colors::red()), || {
|
||||
wallet.task(WalletTask::Cancel(tx.clone()));
|
||||
Modal::close();
|
||||
});
|
||||
}
|
||||
|
||||
// Draw button to repeat transaction action.
|
||||
if tx.can_repeat_action() || rebroadcast {
|
||||
let r = if tx.can_finalize() || tx.can_cancel() {
|
||||
CornerRadius::default()
|
||||
} else {
|
||||
View::item_rounding(0, 2, true)
|
||||
};
|
||||
WalletTransactions::tx_repeat_button_ui(ui, r, tx, wallet, rebroadcast);
|
||||
// Draw button to repeat transaction action.
|
||||
if tx.can_repeat_action() || rebroadcast {
|
||||
let r = if tx.can_finalize() || tx.can_cancel() {
|
||||
CornerRadius::default()
|
||||
} else {
|
||||
View::item_rounding(0, 2, true)
|
||||
};
|
||||
WalletTransactions::tx_repeat_button_ui(ui, r, tx, wallet, rebroadcast);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user