Major refactor of data model

Moved all password data except ID and secret value to SwiftData table as preparation for further data collection
This commit is contained in:
Markus Thielker 2025-01-17 21:49:31 +01:00
parent c3f8103482
commit 61ee809df5
No known key found for this signature in database
10 changed files with 315 additions and 135 deletions

View file

@ -49,7 +49,7 @@ struct passwordApp: App {
WindowGroup {
VStack {
if isAuthenticated {
ListView(viewModel: ListViewModel())
ContextWrapper()
} else {
Button("Authenticate") {
authenticate()
@ -60,5 +60,15 @@ struct passwordApp: App {
authenticate()
}
}
.modelContainer(for: [Password.self])
}
}
struct ContextWrapper: View {
@Environment(\.modelContext) var context
var body: some View {
ListView(viewModel: ListViewModel(context: context))
}
}