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:
parent
c3f8103482
commit
61ee809df5
10 changed files with 315 additions and 135 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue