chore(wallet) lazy load TransactionDetailView

I was debugging a crash at login and found out that
TransactionDetailView was being loaded even when it was not being used;
my debugging code in `onComplete` was trying to access transaction data
from nim which was not set.

Updates #13663
This commit is contained in:
Stefan 2024-03-20 19:32:36 +02:00 committed by Stefan Dunca
parent 72b03e69aa
commit cd2b211f63
1 changed files with 21 additions and 17 deletions

View File

@ -73,6 +73,7 @@ RightTabBaseView {
readonly property var detailedCollectibleActivityController: RootStore.tmpActivityController0
}
// StackLayout.currentIndex === 0
ColumnLayout {
spacing: 0
@ -268,27 +269,30 @@ RightTabBaseView {
}
}
TransactionDetailView {
id: transactionDetailView
controller: RootStore.activityDetailsController
onVisibleChanged: {
if (visible) {
if (!!transaction) {
RootStore.addressWasShown(transaction.sender)
if (transaction.sender !== transaction.recipient) {
RootStore.addressWasShown(transaction.recipient)
Loader {
active: stack.currentIndex === 3
sourceComponent: TransactionDetailView {
controller: RootStore.activityDetailsController
onVisibleChanged: {
if (visible) {
if (!!transaction) {
RootStore.addressWasShown(transaction.sender)
if (transaction.sender !== transaction.recipient) {
RootStore.addressWasShown(transaction.recipient)
}
}
} else {
controller.resetActivityEntry()
}
} else {
controller.resetActivityEntry()
}
showAllAccounts: RootStore.showAllAccounts
communitiesStore: root.communitiesStore
sendModal: root.sendModal
contactsStore: root.contactsStore
networkConnectionStore: root.networkConnectionStore
visible: (stack.currentIndex === 3)
}
showAllAccounts: RootStore.showAllAccounts
communitiesStore: root.communitiesStore
sendModal: root.sendModal
contactsStore: root.contactsStore
networkConnectionStore: root.networkConnectionStore
visible: (stack.currentIndex === 3)
}
}
}