mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Create WFNavigationState class to replace published vars in WFModel
This commit is contained in:
parent
c4aa7e7dfe
commit
e447a6a58e
@ -12,6 +12,7 @@ final class WriteFreelyModel: ObservableObject {
|
||||
@Published var preferences = PreferencesModel()
|
||||
@Published var posts = PostListModel()
|
||||
@Published var editor = PostEditorModel()
|
||||
@Published var navState = WFNavigationState()
|
||||
|
||||
// MARK: - Error handling
|
||||
@Published var hasError: Bool = false
|
||||
@ -45,9 +46,6 @@ final class WriteFreelyModel: ObservableObject {
|
||||
@Published var isLoggingIn: Bool = false
|
||||
@Published var isProcessingRequest: Bool = false
|
||||
@Published var hasNetworkConnection: Bool = true
|
||||
@Published var selectedPost: WFAPost?
|
||||
@Published var selectedCollection: WFACollection?
|
||||
@Published var showAllPosts: Bool = true
|
||||
@Published var isPresentingDeleteAlert: Bool = false
|
||||
@Published var postToDelete: WFAPost?
|
||||
#if os(iOS)
|
||||
|
@ -1,5 +1,17 @@
|
||||
import SwiftUI
|
||||
|
||||
// MARK: - Navigation State
|
||||
|
||||
final class WFNavigationState: ObservableObject {
|
||||
|
||||
@Published var selectedCollection: WFACollection?
|
||||
@Published var selectedPost: WFAPost?
|
||||
@Published var showAllPosts: Bool = true
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Navigation Implementation
|
||||
|
||||
struct WFNavigation<CollectionList, PostList, PostDetail>: View
|
||||
where CollectionList: View, PostList: View, PostDetail: View {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user