From 550d401e74ce3dcf1ccff7a2a0ba01d99d77d5da Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Fri, 31 Jul 2020 14:52:14 -0500 Subject: [PATCH] Fix setting tags on new tasks --- app/src/main/java/org/tasks/ui/TaskEditViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/tasks/ui/TaskEditViewModel.kt b/app/src/main/java/org/tasks/ui/TaskEditViewModel.kt index d6e14760f..fe646aecd 100644 --- a/app/src/main/java/org/tasks/ui/TaskEditViewModel.kt +++ b/app/src/main/java/org/tasks/ui/TaskEditViewModel.kt @@ -334,7 +334,7 @@ class TaskEditViewModel @ViewModelInject constructor( it.modificationDate = currentTimeMillis() } - if (originalTags?.toHashSet() != selectedTags?.toHashSet()) { + if ((isNew && selectedTags?.isNotEmpty() == true) || originalTags?.toHashSet() != selectedTags?.toHashSet()) { tagDao.applyTags(it, tagDataDao, selectedTags!!) it.modificationDate = currentTimeMillis() }