update ui

This commit is contained in:
Evgeny @ SimpleX Chat
2026-05-31 18:37:14 +00:00
parent 3d0f5ff590
commit 8a9b82b796
2 changed files with 16 additions and 4 deletions
@@ -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 {
@@ -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")
}
}