Fixed bug with empty store views hash collision

This commit is contained in:
Maxwell Swadling 2023-03-12 12:23:15 +10:00
parent 98bacbac8b
commit 22fb6255e5

View File

@ -8,11 +8,11 @@ struct EmptyStoreView: View {
var body: some View { var body: some View {
if store is AnySecretStoreModifiable { if store is AnySecretStoreModifiable {
NavigationLink(destination: EmptyStoreModifiableView(), tag: Constants.emptyStoreModifiableTag, selection: $activeSecret) { NavigationLink(destination: EmptyStoreModifiableView(), tag: Constants.emptyStoreModifiableTag + store.name, selection: $activeSecret) {
Text("No Secrets") Text("No Secrets")
} }
} else { } else {
NavigationLink(destination: EmptyStoreImmutableView(), tag: Constants.emptyStoreTag, selection: $activeSecret) { NavigationLink(destination: EmptyStoreImmutableView(), tag: Constants.emptyStoreTag + store.name, selection: $activeSecret) {
Text("No Secrets") Text("No Secrets")
} }
} }
@ -22,8 +22,8 @@ struct EmptyStoreView: View {
extension EmptyStoreView { extension EmptyStoreView {
enum Constants { enum Constants {
static let emptyStoreModifiableTag: AnyHashable = "emptyStoreModifiableTag" static let emptyStoreModifiableTag = "emptyStoreModifiableTag"
static let emptyStoreTag: AnyHashable = "emptyStoreModifiableTag" static let emptyStoreTag = "emptyStoreModifiableTag"
} }
} }