@@ -151,7 +151,8 @@ data class HomeUiModel(
151151 val billState : BillState = BillState .Default ,
152152 val restrictionType : RestrictionType ? = null ,
153153 val isRemoteSendLoading : Boolean = false ,
154- val chatUnreadCount : Int = 0 ,
154+ val splatTipCard : Boolean = false ,
155+ val notificationUnreadCount : Int = 0 ,
155156 val buyModule : Feature = BuyModuleFeature (),
156157 val requestKin : Feature = RequestKinFeature (),
157158 val actions : List <HomeAction > = listOf(HomeAction .GIVE_KIN , HomeAction .TIP_CARD , HomeAction .BALANCE ),
@@ -238,6 +239,18 @@ class HomeViewModel @Inject constructor(
238239 }.launchIn(viewModelScope)
239240
240241 tipController.showTwitterSplat
242+ .onEach { splat ->
243+ viewModelScope.launch {
244+ if (splat) {
245+ delay(300 )
246+ } else {
247+ delay(500 )
248+ }
249+ uiFlow.update {
250+ it.copy(splatTipCard = splat)
251+ }
252+ }
253+ }
241254 .filter { it }
242255 .onEach { delay(500 ) }
243256 .flatMapLatest { tipController.connectedAccount }
@@ -258,7 +271,7 @@ class HomeViewModel @Inject constructor(
258271 primaryAction = ::presentShareableTipCard,
259272 secondaryText = resources.getString(R .string.action_later),
260273 secondaryAction = {
261- tipController.clearTwitterSplat ()
274+ tipController.seenTipCardBanner ()
262275 }
263276 )
264277 )
@@ -333,11 +346,11 @@ class HomeViewModel @Inject constructor(
333346 }
334347 }.launchIn(viewModelScope)
335348
336- historyController.unreadCount
349+ historyController.notificationsUnreadCount
337350 .distinctUntilChanged()
338351 .map { it }
339352 .onEach { count ->
340- uiFlow.update { it.copy(chatUnreadCount = count) }
353+ uiFlow.update { it.copy(notificationUnreadCount = count) }
341354 }.launchIn(viewModelScope)
342355
343356 prefRepository.observeOrDefault(PrefsBool .LOG_SCAN_TIMES , false )
0 commit comments