mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add copy deeplink to iOS
This commit is contained in:
parent
5fa8660c8b
commit
ee82cf9180
1 changed files with 17 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue