Skip to content
Prev Previous commit
Next Next commit
fix(tsupport): restore Log Out for support accounts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Loading branch information
nisarul and Copilot committed Sep 30, 2026
commit 2ee8227c5a38166ca4e4e49a3b869e5205574646
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ enum SettingsSection: Int, CaseIterable {
case payment
case extra
case support
case logout
}

func settingsItems(data: PeerInfoScreenData?, context: AccountContext, presentationData: PresentationData, interaction: PeerInfoInteraction, isExpanded: Bool) -> [(AnyHashable, [PeerInfoScreenItem])] {
Expand Down Expand Up @@ -334,6 +335,14 @@ func settingsItems(data: PeerInfoScreenData?, context: AccountContext, presentat
interaction.openSettings(.tips)
}))

// Log Out normally lives in the editing view, which support accounts cannot open
// (profile editing is blocked). Surface it here so a volunteer can still sign out.
if isSupportUser {
items[.logout]!.append(PeerInfoScreenActionItem(id: 0, text: presentationData.strings.Settings_Logout, color: .destructive, alignment: .center, action: {
interaction.openSettings(.logout)
}))
}

var result: [(AnyHashable, [PeerInfoScreenItem])] = []
for section in SettingsSection.allCases {
if let sectionItems = items[section], !sectionItems.isEmpty {
Expand Down