mid commit
This commit is contained in:
@@ -2,6 +2,7 @@ package dev.dettmer.simplenotes.di
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.room.Room
|
import androidx.room.Room
|
||||||
|
import dev.dettmer.simplenotes.MainViewModel
|
||||||
import dev.dettmer.simplenotes.storage.AppDatabase
|
import dev.dettmer.simplenotes.storage.AppDatabase
|
||||||
import dev.dettmer.simplenotes.storage.NotesStorage
|
import dev.dettmer.simplenotes.storage.NotesStorage
|
||||||
import dev.dettmer.simplenotes.ui.main.MainViewModel
|
import dev.dettmer.simplenotes.ui.main.MainViewModel
|
||||||
@@ -29,5 +30,5 @@ val appModule = module {
|
|||||||
|
|
||||||
single { NotesStorage(androidContext(), get()) }
|
single { NotesStorage(androidContext(), get()) }
|
||||||
|
|
||||||
viewModel { MainViewModel(get(), get()) }
|
viewModel { MainViewModel(get(), get(), get()) }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -211,7 +211,8 @@ class MainViewModel(
|
|||||||
val pendingIds = _pendingDeletions.value
|
val pendingIds = _pendingDeletions.value
|
||||||
val filteredNotes = allNotes.filter { it.id !in pendingIds }.map { Note(
|
val filteredNotes = allNotes.filter { it.id !in pendingIds }.map { Note(
|
||||||
id = it.id,
|
id = it.id,
|
||||||
content = it.content
|
content = it.content,
|
||||||
|
|
||||||
) }
|
) }
|
||||||
|
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
|
|||||||
Reference in New Issue
Block a user