|
@@ -135,13 +135,12 @@ class FoodListActivity : BaseActivity<ActivityFoodListBinding>() {
|
|
val recipesDao = FoodDataProvider.getDatabase().recipeDao()
|
|
val recipesDao = FoodDataProvider.getDatabase().recipeDao()
|
|
val recipesIdList = mutableListOf<String>()
|
|
val recipesIdList = mutableListOf<String>()
|
|
val favoriteRecipesIds = mutableListOf<String>()
|
|
val favoriteRecipesIds = mutableListOf<String>()
|
|
- if (foodListType == Favourite) {
|
|
|
|
- userDao.queryFavoriteRecipes(CURRENT_USER_ID).forEach {
|
|
|
|
|
|
+ userDao.queryFavoriteRecipes(CURRENT_USER_ID).forEach {
|
|
|
|
+ if (foodListType == Favourite) {
|
|
recipesIdList.add(it.favoriteRecipesId)
|
|
recipesIdList.add(it.favoriteRecipesId)
|
|
- favoriteRecipesIds.add(it.favoriteRecipesId)
|
|
|
|
}
|
|
}
|
|
|
|
+ favoriteRecipesIds.add(it.favoriteRecipesId)
|
|
}
|
|
}
|
|
-
|
|
|
|
if (foodListType == History) {
|
|
if (foodListType == History) {
|
|
userDao.queryHistoryRecipes(CURRENT_USER_ID).forEach {
|
|
userDao.queryHistoryRecipes(CURRENT_USER_ID).forEach {
|
|
recipesIdList.add(it.historyRecipesId)
|
|
recipesIdList.add(it.historyRecipesId)
|