Skip to content

Commit

Permalink
fix: settingsview delete seed
Browse files Browse the repository at this point in the history
  • Loading branch information
reez authored Sep 17, 2024
1 parent ca21959 commit 24f77d1
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 217 deletions.
15 changes: 10 additions & 5 deletions BDKSwiftExampleWallet/App/BDKSwiftExampleWalletApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ import SwiftUI
@main
struct BDKSwiftExampleWalletApp: App {
@AppStorage("isOnboarding") var isOnboarding: Bool = true
@State private var navigationPath = NavigationPath()

var body: some Scene {
WindowGroup {
if isOnboarding {
OnboardingView(viewModel: .init(bdkClient: .live))
} else {
HomeView(viewModel: .init(bdkClient: .live))
NavigationStack(path: $navigationPath) {
if isOnboarding {
OnboardingView(viewModel: .init(bdkClient: .live))
} else {
HomeView(viewModel: .init(bdkClient: .live))
}
}
.onChange(of: isOnboarding) { oldValue, newValue in
navigationPath = NavigationPath()
}
}
}

}
2 changes: 2 additions & 0 deletions BDKSwiftExampleWallet/View/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct SettingsView: View {
@State private var showingDeleteSeedConfirmation = false
@State private var showingShowSeedConfirmation = false
@State private var isSeedPresented = false
@Environment(\.dismiss) private var dismiss

var body: some View {

Expand Down Expand Up @@ -112,6 +113,7 @@ struct SettingsView: View {
) {
Button("Yes", role: .destructive) {
viewModel.delete()
dismiss()
}
Button("No", role: .cancel) {}
}
Expand Down
Loading

0 comments on commit 24f77d1

Please sign in to comment.