Show server host or "WriteFreely" in CollectionListView per login state

This commit is contained in:
Angelo Stavrow 2020-09-16 14:42:26 -04:00
parent 7ae7c57442
commit 83acb6e832
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -27,12 +27,14 @@ struct CollectionListView: View {
}
}
}
.navigationTitle("Collections")
.navigationTitle(
model.account.isLoggedIn ? "\(URL(string: model.account.server)?.host ?? "WriteFreely")" : "WriteFreely"
)
.listStyle(SidebarListStyle())
}
}
struct CollectionListView_Previews: PreviewProvider {
struct CollectionListView_LoggedOutPreviews: PreviewProvider {
static var previews: some View {
let context = LocalStorageManager.persistentContainer.viewContext
let model = WriteFreelyModel()