FIX: Notes are not beeing displayed

This commit is contained in:
sebastian 2025-05-10 13:20:40 +02:00
parent b9fe9cf184
commit dd7e9dce65
3 changed files with 5 additions and 3 deletions

View File

@ -4,10 +4,10 @@
<selectionStates> <selectionStates>
<SelectionState runConfigName="app"> <SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" /> <option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-05-10T09:35:55.287804256Z"> <DropdownSelection timestamp="2025-05-10T10:58:30.749991183Z">
<Target type="DEFAULT_BOOT"> <Target type="DEFAULT_BOOT">
<handle> <handle>
<DeviceId pluginId="LocalEmulator" identifier="path=/home/sebastian/.android/avd/Pixel_9.avd" /> <DeviceId pluginId="PhysicalDevice" identifier="serial=R52N50NLGRT" />
</handle> </handle>
</Target> </Target>
</DropdownSelection> </DropdownSelection>

View File

@ -22,6 +22,6 @@ interface NoteDao {
@Update @Update
suspend fun update(note: NoteEntity) suspend fun update(note: NoteEntity)
@Query("SELECT * FROM notes WHERE collectionId = :collectionId") @Query("SELECT * FROM notes WHERE collectionId IS :collectionId")
fun getNotesForCollection(collectionId: Int?): Flow<List<NoteEntity>> fun getNotesForCollection(collectionId: Int?): Flow<List<NoteEntity>>
} }

View File

@ -1,5 +1,6 @@
package come.stormborntales.notevault.ui.viewmodel package come.stormborntales.notevault.ui.viewmodel
import android.util.Log
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import come.stormborntales.notevault.data.local.entity.NoteCollection import come.stormborntales.notevault.data.local.entity.NoteCollection
@ -41,6 +42,7 @@ class NoteBrowserViewModel (
} }
launch { launch {
noteRepository.getNotesForCollection(parentId).collect { noteRepository.getNotesForCollection(parentId).collect {
Log.d("NoteBrowser", "Noten geladen: ${it.size}")
_currentNotes.value = it _currentNotes.value = it
} }
} }