macOS: swiftformat connections settings
This commit is contained in:
@@ -334,7 +334,7 @@ struct ConfigSettings: View {
|
|||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
.disabled(self.hasEnvApiKey)
|
.disabled(self.hasEnvApiKey)
|
||||||
.onChange(of: self.talkApiKey) { _, _ in self.autosaveConfig() }
|
.onChange(of: self.talkApiKey) { _, _ in self.autosaveConfig() }
|
||||||
if !self.hasEnvApiKey && !self.talkApiKey.isEmpty {
|
if !self.hasEnvApiKey, !self.talkApiKey.isEmpty {
|
||||||
Button("Clear") {
|
Button("Clear") {
|
||||||
self.talkApiKey = ""
|
self.talkApiKey = ""
|
||||||
self.autosaveConfig()
|
self.autosaveConfig()
|
||||||
@@ -346,8 +346,8 @@ struct ConfigSettings: View {
|
|||||||
Text("Using ELEVENLABS_API_KEY from the environment.")
|
Text("Using ELEVENLABS_API_KEY from the environment.")
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
} else if self.gatewayApiKeyFound
|
} else if self.gatewayApiKeyFound,
|
||||||
&& self.talkApiKey.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
|
self.talkApiKey.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
|
||||||
{
|
{
|
||||||
Text("Using API key from the gateway profile.")
|
Text("Using API key from the gateway profile.")
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
@@ -468,8 +468,7 @@ struct ConfigSettings: View {
|
|||||||
browserAttachOnly: browserAttachOnly,
|
browserAttachOnly: browserAttachOnly,
|
||||||
talkVoiceId: talkVoiceId,
|
talkVoiceId: talkVoiceId,
|
||||||
talkApiKey: talkApiKey,
|
talkApiKey: talkApiKey,
|
||||||
talkInterruptOnSpeech: talkInterruptOnSpeech
|
talkInterruptOnSpeech: talkInterruptOnSpeech)
|
||||||
)
|
|
||||||
|
|
||||||
let errorMessage = await ConfigSettings.buildAndSaveConfig(draft)
|
let errorMessage = await ConfigSettings.buildAndSaveConfig(draft)
|
||||||
|
|
||||||
@@ -527,7 +526,7 @@ struct ConfigSettings: View {
|
|||||||
do {
|
do {
|
||||||
try await ConfigStore.save(root)
|
try await ConfigStore.save(root)
|
||||||
return nil
|
return nil
|
||||||
} catch let error {
|
} catch {
|
||||||
return error.localizedDescription
|
return error.localizedDescription
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ struct ConnectionsSettings: View {
|
|||||||
|
|
||||||
var sortOrder: Int {
|
var sortOrder: Int {
|
||||||
switch self {
|
switch self {
|
||||||
case .whatsapp: return 0
|
case .whatsapp: 0
|
||||||
case .telegram: return 1
|
case .telegram: 1
|
||||||
case .discord: return 2
|
case .discord: 2
|
||||||
case .signal: return 3
|
case .signal: 3
|
||||||
case .imessage: return 4
|
case .imessage: 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ struct ConnectionsSettingsSmokeTests {
|
|||||||
error: nil,
|
error: nil,
|
||||||
elapsedMs: 120,
|
elapsedMs: 120,
|
||||||
bot: ProvidersStatusSnapshot.TelegramBot(id: 123, username: "clawdisbot"),
|
bot: ProvidersStatusSnapshot.TelegramBot(id: 123, username: "clawdisbot"),
|
||||||
webhook: ProvidersStatusSnapshot.TelegramWebhook(url: "https://example.com/hook", hasCustomCert: false)),
|
webhook: ProvidersStatusSnapshot.TelegramWebhook(
|
||||||
|
url: "https://example.com/hook",
|
||||||
|
hasCustomCert: false)),
|
||||||
lastProbeAt: 1_700_000_050_000),
|
lastProbeAt: 1_700_000_050_000),
|
||||||
discord: nil,
|
discord: nil,
|
||||||
signal: ProvidersStatusSnapshot.SignalStatus(
|
signal: ProvidersStatusSnapshot.SignalStatus(
|
||||||
|
|||||||
Reference in New Issue
Block a user