From 7c7db56c1e5455abd1f829387287115cbaf2eec8 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Wed, 10 Sep 2025 00:24:06 -0700 Subject: [PATCH] Fix unavail modifiable empty store (#686) --- Sources/Secretive/Views/Secrets/StoreListView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/Secretive/Views/Secrets/StoreListView.swift b/Sources/Secretive/Views/Secrets/StoreListView.swift index 2c8d439..d084777 100644 --- a/Sources/Secretive/Views/Secrets/StoreListView.swift +++ b/Sources/Secretive/Views/Secrets/StoreListView.swift @@ -43,7 +43,11 @@ struct StoreListView: View { // Do this to avoid a blip. SecretDetailView(secret: nextDefaultSecret) } else { - EmptyStoreView(store: storeList.modifiableStore ?? storeList.stores.first) + if let modifiable = storeList.modifiableStore, modifiable.isAvailable { + EmptyStoreView(store: modifiable) + } else { + EmptyStoreView(store: storeList.stores.first(where: \.isAvailable)) + } } } .navigationSplitViewStyle(.balanced)