Skip to content

Commit 66266da

Browse files
Merge pull request #116 from writeas/show-drafts-only-when-logged-out
Show drafts only when logged out
2 parents 1170caa + dbf2ecd commit 66266da

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Shared/Navigation/ContentView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ struct ContentView: View {
77
NavigationView {
88
SidebarView()
99

10-
PostListView(selectedCollection: nil, showAllPosts: true)
10+
PostListView(selectedCollection: nil, showAllPosts: model.account.isLoggedIn)
1111

1212
Text("Select a post, or create a new local draft.")
1313
.foregroundColor(.secondary)

Shared/PostCollection/CollectionListView.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ struct CollectionListView: View {
1111

1212
var body: some View {
1313
List {
14-
NavigationLink(destination: PostListView(selectedCollection: nil, showAllPosts: true)) {
15-
Text("All Posts")
16-
}
1714
if model.account.isLoggedIn {
15+
NavigationLink(destination: PostListView(selectedCollection: nil, showAllPosts: true)) {
16+
Text("All Posts")
17+
}
1818
NavigationLink(destination: PostListView(selectedCollection: nil, showAllPosts: false)) {
1919
Text(model.account.server == "https://write.as" ? "Anonymous" : "Drafts")
2020
}
@@ -27,6 +27,10 @@ struct CollectionListView: View {
2727
}
2828
}
2929
}
30+
} else {
31+
NavigationLink(destination: PostListView(selectedCollection: nil, showAllPosts: false)) {
32+
Text("Drafts")
33+
}
3034
}
3135
}
3236
.navigationTitle(

0 commit comments

Comments
 (0)