Skip to content

Commit

Permalink
Add hud for Watchlist add/remove actions from lists
Browse files Browse the repository at this point in the history
  • Loading branch information
ealymbaev committed Jun 6, 2024
1 parent cb83a4f commit 544dfc7
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Combine
import ComponentKit

class WatchlistViewModel: ObservableObject {
private let watchlistManager = App.shared.watchlistManager
Expand All @@ -23,11 +24,15 @@ class WatchlistViewModel: ObservableObject {
extension WatchlistViewModel {
func add(coinUid: String) {
watchlistManager.add(coinUid: coinUid)
HudHelper.instance.show(banner: .addedToWatchlist)

stat(page: page, section: section, event: .addToWatchlist(coinUid: coinUid))
}

func remove(coinUid: String) {
watchlistManager.remove(coinUid: coinUid)
HudHelper.instance.show(banner: .removedFromWatchlist)

stat(page: page, section: section, event: .removeFromWatchlist(coinUid: coinUid))
}
}

0 comments on commit 544dfc7

Please sign in to comment.