Skip to content

Commit 8665009

Browse files
committed
Update topic copy link toasts
1 parent 3ded327 commit 8665009

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Modules/Sources/TopicFeature/TopicFeature.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public struct TopicFeature: Reducer, Sendable {
3030
// MARK: - Localizations
3131

3232
private enum Localization {
33+
static let linkCopied = LocalizedStringResource("Link copied", bundle: .module)
3334
static let favoriteAdded = LocalizedStringResource("Added to favorites", bundle: .module)
3435
static let favoriteRemoved = LocalizedStringResource("Removed from favorites", bundle: .module)
3536
static let postDeleted = LocalizedStringResource("Post deleted", bundle: .module)
@@ -254,7 +255,9 @@ public struct TopicFeature: Reducer, Sendable {
254255

255256
case .copyLink:
256257
pasteboardClient.copy("https://4pda.to/forum/index.php?showtopic=\(topic.id)")
257-
return .none
258+
return .run { _ in
259+
await toastClient.showToast(ToastMessage(text: Localization.linkCopied, haptic: .success))
260+
}
258261

259262
case .setFavorite:
260263
return .run { [id = state.topicId] send in
@@ -336,8 +339,7 @@ public struct TopicFeature: Reducer, Sendable {
336339
let link = "https://4pda.to/forum/index.php?showtopic=\(state.topicId)&view=findpost&p=\(postId)"
337340
pasteboardClient.copy(link)
338341
return .run { _ in
339-
let toast = ToastMessage(text: LocalizedStringResource("Link copied", bundle: .module), haptic: .success)
340-
await toastClient.showToast(toast)
342+
await toastClient.showToast(ToastMessage(text: Localization.linkCopied, haptic: .success))
341343
}
342344
}
343345

0 commit comments

Comments
 (0)