macOS: swiftformat connections settings

This commit is contained in:
Shadow
2026-01-02 12:30:59 -06:00
parent 5e36390a27
commit 96a5e01878
3 changed files with 13 additions and 12 deletions

View File

@@ -334,7 +334,7 @@ struct ConfigSettings: View {
.frame(maxWidth: .infinity)
.disabled(self.hasEnvApiKey)
.onChange(of: self.talkApiKey) { _, _ in self.autosaveConfig() }
if !self.hasEnvApiKey && !self.talkApiKey.isEmpty {
if !self.hasEnvApiKey, !self.talkApiKey.isEmpty {
Button("Clear") {
self.talkApiKey = ""
self.autosaveConfig()
@@ -346,8 +346,8 @@ struct ConfigSettings: View {
Text("Using ELEVENLABS_API_KEY from the environment.")
.font(.footnote)
.foregroundStyle(.secondary)
} else if self.gatewayApiKeyFound
&& self.talkApiKey.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
} else if self.gatewayApiKeyFound,
self.talkApiKey.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
{
Text("Using API key from the gateway profile.")
.font(.footnote)
@@ -468,8 +468,7 @@ struct ConfigSettings: View {
browserAttachOnly: browserAttachOnly,
talkVoiceId: talkVoiceId,
talkApiKey: talkApiKey,
talkInterruptOnSpeech: talkInterruptOnSpeech
)
talkInterruptOnSpeech: talkInterruptOnSpeech)
let errorMessage = await ConfigSettings.buildAndSaveConfig(draft)
@@ -527,7 +526,7 @@ struct ConfigSettings: View {
do {
try await ConfigStore.save(root)
return nil
} catch let error {
} catch {
return error.localizedDescription
}
}

View File

@@ -13,11 +13,11 @@ struct ConnectionsSettings: View {
var sortOrder: Int {
switch self {
case .whatsapp: return 0
case .telegram: return 1
case .discord: return 2
case .signal: return 3
case .imessage: return 4
case .whatsapp: 0
case .telegram: 1
case .discord: 2
case .signal: 3
case .imessage: 4
}
}
}