Add copy deeplink to iOS
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user