Skip to content

Commit

Permalink
Don't show ourselves in the "all apps" tab
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Sep 18, 2024
1 parent 32baa94 commit 1f6664c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ package nl.ndat.tvlauncher.ui.tab.apps
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn
import nl.ndat.tvlauncher.BuildConfig
import nl.ndat.tvlauncher.data.repository.AppRepository
import nl.ndat.tvlauncher.data.sqldelight.App

class AppsTabViewModel(
private val appRepository: AppRepository,
) : ViewModel() {
val apps = appRepository.getApps()
// Hide launcher app from showing
.map { apps -> apps.filterNot { app -> app.packageName == BuildConfig.APPLICATION_ID } }
.stateIn(viewModelScope, SharingStarted.Eagerly, emptyList())

fun favoriteApp(app: App, favorite: Boolean) {
Expand Down

0 comments on commit 1f6664c

Please sign in to comment.