mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 20:48:19 +00:00
update ui
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user