fix: do not show file button at message finalization, qr code padding, request message at tx info modal

This commit is contained in:
ardocrat 2024-06-05 17:30:03 +03:00
parent d2c5bdb53f
commit 2688bf606e
2 changed files with 14 additions and 9 deletions

View file

@ -487,7 +487,6 @@ impl WalletMessages {
self.request_qr = false;
}
self.request_qr_content.ui(ui, text.clone(), cb);
ui.add_space(6.0);
// Show button to close modal.
ui.vertical_centered_justified(|ui| {
@ -823,7 +822,7 @@ impl WalletMessages {
self.message_slate = None;
}
});
} else {
} else if self.message_slate.is_none() {
// Draw button to choose file.
let mut parsed_text = "".to_string();
self.file_pick_button.ui(ui, cb, |text| {
@ -884,7 +883,6 @@ impl WalletMessages {
// Draw QR code content.
let text = self.qr_message_text.clone().unwrap();
self.qr_message_content.ui(ui, text.clone(), cb);
ui.add_space(8.0);
ui.vertical_centered_justified(|ui| {
View::button(ui, t!("close"), Colors::white_or_black(false), || {

View file

@ -525,15 +525,22 @@ impl WalletTransactions {
};
// Setup slate and message from transaction.
self.tx_info_response_edit = if !tx.data.confirmed && tx.can_finalize &&
self.tx_info_response_edit = if !tx.data.confirmed && tx.data.tx_slate_id.is_some() &&
(tx.data.tx_type == TxLogEntryType::TxSent ||
tx.data.tx_type == TxLogEntryType::TxReceived) {
let invoice = tx.data.tx_type == TxLogEntryType::TxReceived;
let mut slate = Slate::blank(1, invoice);
slate.state = if invoice {
SlateState::Invoice1
let mut slate = Slate::blank(1, false);
slate.state = if tx.can_finalize {
if tx.data.tx_type == TxLogEntryType::TxSent {
SlateState::Standard1
} else {
SlateState::Invoice1
}
} else {
SlateState::Standard1
if tx.data.tx_type == TxLogEntryType::TxReceived {
SlateState::Standard2
} else {
SlateState::Invoice2
}
};
slate.id = tx.data.tx_slate_id.unwrap();
wallet.read_slatepack(&slate).unwrap_or("".to_string())