ChoiceSheet: Add alert when user copies a link
Signed-off-by: kingbri <bdashore3@gmail.com>
This commit is contained in:
parent
f45f05a3f5
commit
210faeff9e
1 changed files with 18 additions and 0 deletions
|
|
@ -17,6 +17,8 @@ struct MagnetChoiceView: View {
|
||||||
@AppStorage("RealDebrid.Enabled") var realDebridEnabled = false
|
@AppStorage("RealDebrid.Enabled") var realDebridEnabled = false
|
||||||
|
|
||||||
@State private var showActivityView = false
|
@State private var showActivityView = false
|
||||||
|
@State private var showLinkCopyAlert = false
|
||||||
|
@State private var showMagnetCopyAlert = false
|
||||||
@State private var activityItem: ActivityItem?
|
@State private var activityItem: ActivityItem?
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
|
@ -50,6 +52,14 @@ struct MagnetChoiceView: View {
|
||||||
|
|
||||||
ListRowButtonView("Copy download URL", systemImage: "doc.on.doc.fill") {
|
ListRowButtonView("Copy download URL", systemImage: "doc.on.doc.fill") {
|
||||||
UIPasteboard.general.string = debridManager.realDebridDownloadUrl
|
UIPasteboard.general.string = debridManager.realDebridDownloadUrl
|
||||||
|
showLinkCopyAlert.toggle()
|
||||||
|
}
|
||||||
|
.alert(isPresented: $showLinkCopyAlert) {
|
||||||
|
Alert(
|
||||||
|
title: Text("Copied"),
|
||||||
|
message: Text("Download link copied successfully"),
|
||||||
|
dismissButton: .cancel(Text("OK"))
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
ListRowButtonView("Share download URL", systemImage: "square.and.arrow.up.fill") {
|
ListRowButtonView("Share download URL", systemImage: "square.and.arrow.up.fill") {
|
||||||
|
|
@ -66,6 +76,14 @@ struct MagnetChoiceView: View {
|
||||||
Section("Magnet options") {
|
Section("Magnet options") {
|
||||||
ListRowButtonView("Copy magnet", systemImage: "doc.on.doc.fill") {
|
ListRowButtonView("Copy magnet", systemImage: "doc.on.doc.fill") {
|
||||||
UIPasteboard.general.string = scrapingModel.selectedSearchResult?.magnetLink
|
UIPasteboard.general.string = scrapingModel.selectedSearchResult?.magnetLink
|
||||||
|
showMagnetCopyAlert.toggle()
|
||||||
|
}
|
||||||
|
.alert(isPresented: $showMagnetCopyAlert) {
|
||||||
|
Alert(
|
||||||
|
title: Text("Copied"),
|
||||||
|
message: Text("Magnet link copied successfully"),
|
||||||
|
dismissButton: .cancel(Text("OK"))
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
ListRowButtonView("Share magnet", systemImage: "square.and.arrow.up.fill") {
|
ListRowButtonView("Share magnet", systemImage: "square.and.arrow.up.fill") {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue