From 26b0d7b118e81de05663a3636d3a2bcee0d433f8 Mon Sep 17 00:00:00 2001 From: psmattas Date: Tue, 18 Aug 2026 16:49:45 +0100 Subject: [PATCH] fix(settings): grey out API & Access while offline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New API Key/delete were already gated on isEffectivelyOnline, but nothing visually signaled offline state the way Preferences/Profile do — added the same offline hint banner plus dimmed+disabled the key list itself, and gated the sheet's own Create button too (in case Offline Mode gets toggled on while the sheet is already open). --- Outpost/Features/Account/SettingsView.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Outpost/Features/Account/SettingsView.swift b/Outpost/Features/Account/SettingsView.swift index b5ca05f..5d0e539 100644 --- a/Outpost/Features/Account/SettingsView.swift +++ b/Outpost/Features/Account/SettingsView.swift @@ -764,6 +764,10 @@ struct SettingsView: View { Divider().frame(maxWidth: 480) + if !isEffectivelyOnline { + offlineSettingsHint + } + HStack { Text("Personal keys") .font(.headline) @@ -774,6 +778,8 @@ struct SettingsView: View { .frame(maxWidth: 480) apiKeysList + .disabled(!isEffectivelyOnline) + .opacity(isEffectivelyOnline ? 1 : 0.4) } .task { await refreshApiKeys() } .sheet(isPresented: $isShowingCreateApiKey) { @@ -908,7 +914,7 @@ struct SettingsView: View { } else { Button("Create") { Task { await createApiKey() } } .buttonStyle(.borderedProminent) - .disabled(newApiKeyName.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty) + .disabled(newApiKeyName.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty || !isEffectivelyOnline) } } }