feat: Update ListDetailViewModel to fetch fields for the list with debounce support
This commit is contained in:
+8
-1
@@ -41,7 +41,6 @@ class ListDetailViewModel(
|
||||
.debounce(75)
|
||||
.collect { listWithFields ->
|
||||
_list.value = listWithFields?.list
|
||||
_fields.value = listWithFields?.fields ?: emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +49,14 @@ class ListDetailViewModel(
|
||||
_items.value = itemsData
|
||||
}
|
||||
}
|
||||
|
||||
viewModelScope.launch {
|
||||
database.fieldDao().getFieldsForList(listId)
|
||||
.debounce(75)
|
||||
.collect { fieldsData ->
|
||||
_fields.value = fieldsData
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun startPeriodicSync() {
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user