Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ struct SettingsConnectTab: View {
gatewayUrlText = store.ingressPublicBaseUrl
}
}
.onChange(of: store.twilioHasCredentials) { _, hasCredentials in
if !hasCredentials {
twilioSetupExpanded = false
twilioNumberPickerExpanded = false
}
}
.alert("Regenerate Bearer Token", isPresented: $showingRegenerateConfirmation) {
Button("Cancel", role: .cancel) {}
Button("Regenerate", role: .destructive) {
Expand Down Expand Up @@ -382,10 +388,6 @@ struct SettingsConnectTab: View {
value: "Configured",
action: .init(label: "Clear", style: .danger, disabled: store.twilioSaveInProgress) {
store.clearTwilioCredentials()
twilioSetupExpanded = false
twilioNumberPickerExpanded = false
store.twilioNumbers = []
store.twilioPhoneNumber = nil
}
)
} else if twilioSetupExpanded {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,19 @@ public final class SettingsStore: ObservableObject {
self.twilioListInProgress = false
if response.success {
self.twilioHasCredentials = response.hasCredentials
if self.twilioPhoneRefreshPending || response.phoneNumber != nil {
if !response.hasCredentials {
// Credentials were confirmed removed — clear derived state
self.twilioPhoneNumber = nil
self.twilioNumbers = []
Comment on lines +354 to +357
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve stored phone number on credentialless config responses

onTwilioConfigResponse now clears twilioPhoneNumber whenever response.hasCredentials is false, which drops the phone number returned by successful get responses for accounts that have an assigned number but no active credentials. The daemon explicitly preserves and reports that number (assistant/src/daemon/handlers/config.ts, comments around clear_credentials and get response fields) so users can re-enter credentials without reassigning; after this change, the macOS store forgets it and the UI shows "Not assigned" until a later manual reassignment/refresh flow repopulates it.

Useful? React with 👍 / 👎.

} else if self.twilioPhoneRefreshPending || response.phoneNumber != nil {
self.twilioPhoneNumber = response.phoneNumber
}
if self.twilioNumbersRefreshPending {
self.twilioNumbers = response.numbers ?? []
} else if let numbers = response.numbers {
self.twilioNumbers = numbers
if response.hasCredentials {
if self.twilioNumbersRefreshPending {
self.twilioNumbers = response.numbers ?? []
} else if let numbers = response.numbers {
self.twilioNumbers = numbers
}
}
self.twilioWarning = response.warning
self.twilioError = nil
Expand Down
Loading