Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #8721: Approve transaction does not show confirmation after editi…
Browse files Browse the repository at this point in the history
…ng allowance (#8725)

* Fix case where `TransactionConfirmationStore` is torn down from observation when opening a detail view to edit approve tx permissions, which can cause spinner to show until transaction confirmation modal is dismissed because we miss the transaction updated observation method callback.

* Close stores on dismiss of modal to cover case where user manually dismisses modal RequestContainerView
  • Loading branch information
StephenHeaps authored Feb 1, 2024
1 parent ae3bb35 commit c82539f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Sources/BraveWallet/Panels/RequestContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ struct RequestContainerView<DismissContent: ToolbarContent>: View {
keyringStore: keyringStore,
onDismiss: onDismiss
)
.onDisappear {
cryptoStore.closeConfirmationStore()
}
case .addSuggestedToken(let request):
AddSuggestedTokenView(
token: request.token,
Expand Down Expand Up @@ -62,9 +59,6 @@ struct RequestContainerView<DismissContent: ToolbarContent>: View {
networkStore: cryptoStore.networkStore,
onDismiss: onDismiss
)
.onDisappear {
cryptoStore.closeSignMessageRequestStore()
}
case let .signMessageError(signMessageErrors):
SignMessageErrorView(
signMessageErrors: signMessageErrors,
Expand Down Expand Up @@ -108,8 +102,11 @@ struct RequestContainerView<DismissContent: ToolbarContent>: View {
}
}
.navigationViewStyle(.stack)
.onAppear {
// TODO: Fetch pending requests
.onDisappear {
// `onDisappear` on individual views will trigger for navigation pushes.
// Close stores when navigation covers manual dismiss & onDismiss() cases.
cryptoStore.closeConfirmationStore()
cryptoStore.closeSignMessageRequestStore()
}
}
}

0 comments on commit c82539f

Please sign in to comment.