Avoids remembering edit lists that will never exist.
This commit is contained in:
@@ -1014,7 +1014,7 @@ fun observeEdits(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
): State<GenericLoadable<EditState>> {
|
): State<GenericLoadable<EditState>> {
|
||||||
if (baseNote.event !is TextNoteEvent) {
|
if (baseNote.event !is TextNoteEvent) {
|
||||||
return remember { mutableStateOf(GenericLoadable.Empty()) }
|
return EmptyState
|
||||||
}
|
}
|
||||||
|
|
||||||
val editState =
|
val editState =
|
||||||
|
|||||||
@@ -223,6 +223,8 @@ fun RenderTextModificationEvent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val EmptyState = mutableStateOf<GenericLoadable<EditState>>(GenericLoadable.Empty())
|
||||||
|
|
||||||
@Stable
|
@Stable
|
||||||
class EditState {
|
class EditState {
|
||||||
private var modificationsList: List<Note> = persistentListOf()
|
private var modificationsList: List<Note> = persistentListOf()
|
||||||
|
|||||||
Reference in New Issue
Block a user