Fix some url broken on iOS

This commit is contained in:
2020-12-07 00:29:10 +01:00
parent 3aee0e9a6a
commit f5075f4da8
2 changed files with 2 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ struct AttachmentView: View {
Spacer() Spacer()
Button(action: { Button(action: {
guard let url = URL(string: attachmentUrl) else { return } guard let url = URL(string: attachmentUrl.addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)!) else { return }
UIApplication.shared.open(url) UIApplication.shared.open(url)
}) { }) {
Image(systemName: "envelope.open") Image(systemName: "envelope.open")

View File

@@ -50,7 +50,7 @@ struct CircularView: View {
if showDetail { if showDetail {
HStack { HStack {
Button(action: { Button(action: {
guard let url = URL(string: circular.url) else { return } guard let url = URL(string: circular.url.addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)!) else { return }
UIApplication.shared.open(url) UIApplication.shared.open(url)
}) { }) {
Image(systemName: "envelope.open") Image(systemName: "envelope.open")