From 8a9b82b7962f27d6d5ae5e4464921b1559f1320c Mon Sep 17 00:00:00 2001 From: "Evgeny @ SimpleX Chat" <259188159+evgeny-simplex@users.noreply.github.com> Date: Sun, 31 May 2026 18:37:14 +0000 Subject: [PATCH] update ui --- .../Views/Chat/Group/ChannelWebAccessView.swift | 13 ++++++++++++- .../Shared/Views/Chat/Group/GroupChatInfoView.swift | 7 ++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/ios/Shared/Views/Chat/Group/ChannelWebAccessView.swift b/apps/ios/Shared/Views/Chat/Group/ChannelWebAccessView.swift index ede93194d2..0283c38a18 100644 --- a/apps/ios/Shared/Views/Chat/Group/ChannelWebAccessView.swift +++ b/apps/ios/Shared/Views/Chat/Group/ChannelWebAccessView.swift @@ -34,7 +34,7 @@ struct ChannelWebAccessView: View { .disableAutocorrection(true) Toggle("Allow embedding", isOn: $allowEmbedding) } header: { - Text("Web access") + Text("Web page") } footer: { Text("Set a web page URL where your channel preview is hosted. Allow embedding to let any website embed the preview.") } @@ -73,6 +73,17 @@ struct ChannelWebAccessView: View { await MainActor.run { groupRelays = relays } } } + .onDisappear { + if hasChanges { + showAlert( + title: NSLocalizedString("Save web access settings?", comment: "alert title"), + message: NSLocalizedString("Web access settings were changed. If you save, the updated settings will be sent to channel subscribers.", comment: "alert message"), + buttonTitle: NSLocalizedString("Save", comment: "alert button"), + buttonAction: saveAccess, + cancelButton: true + ) + } + } } private var hasChanges: Bool { diff --git a/apps/ios/Shared/Views/Chat/Group/GroupChatInfoView.swift b/apps/ios/Shared/Views/Chat/Group/GroupChatInfoView.swift index d6ba8b3f68..cea201d1a4 100644 --- a/apps/ios/Shared/Views/Chat/Group/GroupChatInfoView.swift +++ b/apps/ios/Shared/Views/Chat/Group/GroupChatInfoView.swift @@ -659,12 +659,13 @@ struct GroupChatInfoView: View { } private func channelWebAccessButton() -> some View { - NavigationLink { + let title: LocalizedStringKey = groupInfo.useRelays ? "Channel page & name" : "Group page & name" + return NavigationLink { ChannelWebAccessView(groupInfo: $groupInfo) - .navigationBarTitle("Web access") + .navigationBarTitle(title) .navigationBarTitleDisplayMode(.large) } label: { - Label("Web page", systemImage: "globe") + Label(title, systemImage: "globe") } }