diff --git a/app/src/main/java/xyz/pixelatedw/recipe/utils/RecipeParser.kt b/app/src/main/java/xyz/pixelatedw/recipe/utils/RecipeParser.kt index 9aa5c4d..f79ca45 100644 --- a/app/src/main/java/xyz/pixelatedw/recipe/utils/RecipeParser.kt +++ b/app/src/main/java/xyz/pixelatedw/recipe/utils/RecipeParser.kt @@ -47,7 +47,11 @@ fun parseRecipeFiles(ctx: MainActivity) { } // Clearing unused tags after an import/sync - val usedTags = ctx.recipeView.tagFilters.value.map { t -> t.tag } + val usedTags = ctx.db.recipeWithTagsDao().getAll() + .asSequence() + .flatMap { it.tags } + .map { it.name } + .toList() for (tag in ctx.db.tagDao().getAll()) { if (!usedTags.contains(tag.name)) { ctx.db.tagDao().delete(tag.name)