diff --git a/LDKNodeMonday/App/LDKNodeMondayApp.swift b/LDKNodeMonday/App/LDKNodeMondayApp.swift index 8726350..cea0d68 100644 --- a/LDKNodeMonday/App/LDKNodeMondayApp.swift +++ b/LDKNodeMonday/App/LDKNodeMondayApp.swift @@ -19,7 +19,7 @@ struct LDKNodeMondayApp: App { if isOnboarding { OnboardingView(viewModel: .init()) } else { - StartView(viewModel: .init()) + StartView(viewModel: .init(), navigationPath: $navigationPath) } } .onChange(of: isOnboarding) { oldValue, newValue in diff --git a/LDKNodeMonday/View Model/Home/OnboardingViewModel.swift b/LDKNodeMonday/View Model/Home/OnboardingViewModel.swift index ac3e467..036a783 100644 --- a/LDKNodeMonday/View Model/Home/OnboardingViewModel.swift +++ b/LDKNodeMonday/View Model/Home/OnboardingViewModel.swift @@ -106,7 +106,9 @@ class OnboardingViewModel: ObservableObject { try KeyClient.live.saveNetwork(selectedNetwork.description) try KeyClient.live.saveEsploraURL(selectedURL) LightningNodeService.shared = LightningNodeService() - self.isOnboarding = false + DispatchQueue.main.async { + self.isOnboarding = false + } } catch let error as NodeError { let errorString = handleNodeError(error) DispatchQueue.main.async { diff --git a/LDKNodeMonday/View/Home/BitcoinView.swift b/LDKNodeMonday/View/Home/BitcoinView.swift index f5a33cd..e5777bc 100644 --- a/LDKNodeMonday/View/Home/BitcoinView.swift +++ b/LDKNodeMonday/View/Home/BitcoinView.swift @@ -20,7 +20,7 @@ struct BitcoinView: View { @State private var showingNodeIDView = false @StateObject var viewModel: BitcoinViewModel @StateObject private var eventService = EventService() - @State private var sendNavigationPath = NavigationPath() + @Binding var sendNavigationPath: NavigationPath var body: some View { @@ -346,6 +346,6 @@ enum NavigationDestination: Hashable { #if DEBUG #Preview { - BitcoinView(viewModel: .init(priceClient: .mock)) + BitcoinView(viewModel: .init(priceClient: .mock), sendNavigationPath: .constant(.init())) } #endif diff --git a/LDKNodeMonday/View/Home/Send/AddressView.swift b/LDKNodeMonday/View/Home/Send/AddressView.swift index ff96181..7c0040e 100644 --- a/LDKNodeMonday/View/Home/Send/AddressView.swift +++ b/LDKNodeMonday/View/Home/Send/AddressView.swift @@ -119,8 +119,12 @@ struct CustomScannerView: View { var body: some View { GeometryReader { geometry in ZStack(alignment: .top) { - CodeScannerView(codeTypes: codeTypes, completion: completion) - .edgesIgnoringSafeArea(.all) + CodeScannerView( + codeTypes: codeTypes, + shouldVibrateOnSuccess: true, + completion: completion + ) + .edgesIgnoringSafeArea(.all) VStack { HStack { diff --git a/LDKNodeMonday/View/Home/StartView.swift b/LDKNodeMonday/View/Home/StartView.swift index 879b4ba..e2b5354 100644 --- a/LDKNodeMonday/View/Home/StartView.swift +++ b/LDKNodeMonday/View/Home/StartView.swift @@ -13,6 +13,7 @@ struct StartView: View { @ObservedObject var viewModel: StartViewModel @State private var showingStartViewErrorAlert = false @State var startViewError: MondayError? + @Binding var navigationPath: NavigationPath var body: some View { @@ -21,8 +22,11 @@ struct StartView: View { .ignoresSafeArea() if viewModel.isStarted { - BitcoinView(viewModel: .init(priceClient: .live)) - .edgesIgnoringSafeArea(.all) + BitcoinView( + viewModel: .init(priceClient: .live), + sendNavigationPath: $navigationPath + ) + .edgesIgnoringSafeArea(.all) } else { VStack(spacing: 20) { Image(systemName: "bolt.horizontal") @@ -90,6 +94,6 @@ struct StartView: View { #if DEBUG #Preview { - StartView(viewModel: .init()) + StartView(viewModel: .init(), navigationPath: .constant(.init())) } #endif