Skip to content

Commit 5ca0795

Browse files
committed
Update favorites toasts
1 parent 8b73d81 commit 5ca0795

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

Modules/Sources/FavoritesFeature/FavoritesFeature.swift

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

2626
public enum Localization {
27-
static let actionCompleted = LocalizedStringResource("Action completed", bundle: .module)
2827
static let markAsReadSuccess = LocalizedStringResource("Marked as read", bundle: .module)
2928
static let notifyTypeChanged = LocalizedStringResource("Notify type changed", bundle: .module)
3029
static let sortFiltersChanged = LocalizedStringResource("Sort filters are changed", bundle: .module)
@@ -214,8 +213,7 @@ public struct FavoritesFeature: Reducer, Sendable {
214213
.run { send in
215214
let request = SetFavoriteRequest(id: id, action: .delete, type: isForum ? .forum : .topic)
216215
let status = try await apiClient.setFavorite(request)
217-
let actionCompleted = ToastMessage(text: Localization.actionCompleted, haptic: .success)
218-
await toastClient.showToast(status ? actionCompleted : .whoopsSomethingWentWrong)
216+
await toastClient.showToast(status ? .actionCompleted : .whoopsSomethingWentWrong)
219217
},
220218

221219
.send(.internal(.refresh))
@@ -226,8 +224,7 @@ public struct FavoritesFeature: Reducer, Sendable {
226224
.run { send in
227225
let request = SetFavoriteRequest(id: id, action: pin ? .pin : .unpin, type: isForum ? .forum : .topic)
228226
let status = try await apiClient.setFavorite(request)
229-
let actionCompleted = ToastMessage(text: Localization.actionCompleted, haptic: .success)
230-
await toastClient.showToast(status ? actionCompleted : .whoopsSomethingWentWrong)
227+
await toastClient.showToast(status ? .actionCompleted : .whoopsSomethingWentWrong)
231228
},
232229

233230
.send(.internal(.refresh))
@@ -237,8 +234,7 @@ public struct FavoritesFeature: Reducer, Sendable {
237234
return .concatenate(
238235
.run { [id, isForum] send in
239236
let status = try await apiClient.markRead(id: id, isTopic: !isForum)
240-
let actionCompleted = ToastMessage(text: Localization.actionCompleted, haptic: .success)
241-
await toastClient.showToast(status ? actionCompleted : .whoopsSomethingWentWrong)
237+
await toastClient.showToast(status ? .actionCompleted : .whoopsSomethingWentWrong)
242238
},
243239

244240
.send(.internal(.refresh))

Modules/Sources/FavoritesFeature/Resources/Localizable.xcstrings

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
{
22
"sourceLanguage" : "en",
33
"strings" : {
4-
"Action completed" : {
5-
"localizations" : {
6-
"ru" : {
7-
"stringUnit" : {
8-
"state" : "translated",
9-
"value" : "Действие выполнено"
10-
}
11-
}
12-
}
13-
},
144
"Always" : {
155
"localizations" : {
166
"ru" : {
@@ -241,6 +231,16 @@
241231
}
242232
}
243233
},
234+
"Sort filters are changed" : {
235+
"localizations" : {
236+
"ru" : {
237+
"stringUnit" : {
238+
"state" : "translated",
239+
"value" : "Фильтры сортировки обновлены"
240+
}
241+
}
242+
}
243+
},
244244
"To Important" : {
245245
"localizations" : {
246246
"ru" : {

0 commit comments

Comments
 (0)