Add copy deeplink to iOS

This commit is contained in:
Jackson Harper
2023-05-26 12:30:59 +08:00
parent 5fa8660c8b
commit ee82cf9180

View File

@ -244,6 +244,10 @@ struct WebReaderContainerView: View {
label: { Label("Share Original", systemImage: "square.and.arrow.up") }
)
}
Button(
action: copyDeeplink,
label: { Label("Copy Deeplink", systemImage: "link") }
)
Button(
action: delete,
label: { Label("Delete", systemImage: "trash") }
@ -587,6 +591,19 @@ struct WebReaderContainerView: View {
shareActionID = UUID()
}
func copyDeeplink() {
if let deepLink = item.deepLink {
#if os(iOS)
UIPasteboard.general.string = deepLink.absoluteString
#else
Pasteboard.general.string = deepLink.absoluteString
#endif
showInSnackbar("Deeplink Copied")
} else {
showInSnackbar("Error copying deeplink")
}
}
func delete() {
showDeleteConfirmation = true
}