Skip to content

Commit 3ded327

Browse files
committed
Add copy link toast to favorites
1 parent 1b04157 commit 3ded327

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Modules/Sources/FavoritesFeature/FavoritesFeature.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public struct FavoritesFeature: Reducer, Sendable {
2424
// MARK: - Localizations
2525

2626
public enum Localization {
27+
static let linkCopied = LocalizedStringResource("Link copied", bundle: .module)
2728
static let markAsReadSuccess = LocalizedStringResource("Marked as read", bundle: .module)
2829
static let notifyTypeChanged = LocalizedStringResource("Notify type changed", bundle: .module)
2930
static let sortFiltersChanged = LocalizedStringResource("Sort filters are changed", bundle: .module)
@@ -206,7 +207,9 @@ public struct FavoritesFeature: Reducer, Sendable {
206207
case .copyLink(let id):
207208
let show = isForum ? "showforum" : "showtopic"
208209
pasteboardClient.copy("https://4pda.to/forum/index.php?\(show)=\(id)")
209-
return .none
210+
return .run { _ in
211+
await toastClient.showToast(ToastMessage(text: Localization.linkCopied, haptic: .success))
212+
}
210213

211214
case .delete(let id):
212215
return .concatenate(

Modules/Sources/FavoritesFeature/Resources/Localizable.xcstrings

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@
131131
}
132132
}
133133
},
134+
"Link copied" : {
135+
"localizations" : {
136+
"ru" : {
137+
"stringUnit" : {
138+
"state" : "translated",
139+
"value" : "Ссылка скопирована"
140+
}
141+
}
142+
}
143+
},
134144
"Mark As Read" : {
135145
"localizations" : {
136146
"ru" : {

0 commit comments

Comments
 (0)