mirror of
https://github.com/Ferrite-iOS/Ferrite.git
synced 2026-03-11 17:45:40 +00:00
ChoiceSheet: Add alert when user copies a link
Signed-off-by: kingbri <bdashore3@gmail.com>
This commit is contained in:
parent
7c86204a32
commit
a9a64a86e1
1 changed files with 18 additions and 0 deletions
|
|
@ -17,6 +17,8 @@ struct MagnetChoiceView: View {
|
|||
@AppStorage("RealDebrid.Enabled") var realDebridEnabled = false
|
||||
|
||||
@State private var showActivityView = false
|
||||
@State private var showLinkCopyAlert = false
|
||||
@State private var showMagnetCopyAlert = false
|
||||
@State private var activityItem: ActivityItem?
|
||||
|
||||
var body: some View {
|
||||
|
|
@ -50,6 +52,14 @@ struct MagnetChoiceView: View {
|
|||
|
||||
ListRowButtonView("Copy download URL", systemImage: "doc.on.doc.fill") {
|
||||
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") {
|
||||
|
|
@ -66,6 +76,14 @@ struct MagnetChoiceView: View {
|
|||
Section("Magnet options") {
|
||||
ListRowButtonView("Copy magnet", systemImage: "doc.on.doc.fill") {
|
||||
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") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue