fix(preference): Minus and Plus assign missing set(...) call

This commit is contained in:
Ahmad Ansori Palembani 2024-08-16 07:06:22 +07:00
parent 0374942a34
commit f15fbdc8cb
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
3 changed files with 6 additions and 3 deletions

View file

@ -9,6 +9,9 @@
## Other ?? Technical stuff, what happened behind the scene ## Other ?? Technical stuff, what happened behind the scene
--> -->
## Fixes
- Fixed some preference not being saved properly
## Other ## Other
- Update dependency co.touchlab:kermit to v2.0.4 - Update dependency co.touchlab:kermit to v2.0.4
- Update lifecycle to v2.8.4 - Update lifecycle to v2.8.4

View file

@ -887,7 +887,7 @@ class LibraryPresenter(
return items to hiddenItems return items to hiddenItems
} }
private suspend fun getLibraryItems( private fun getLibraryItems(
allCategories: List<Category>, allCategories: List<Category>,
libraryManga: List<LibraryManga>, libraryManga: List<LibraryManga>,
sortingMode: Int, sortingMode: Int,

View file

@ -54,11 +54,11 @@ inline fun <reified T, R : T> Preference<T>.getAndSet(crossinline block: (T) ->
) )
operator fun <T> Preference<Set<T>>.plusAssign(item: Collection<T>) { operator fun <T> Preference<Set<T>>.plusAssign(item: Collection<T>) {
get() + item set(get() + item)
} }
operator fun <T> Preference<Set<T>>.minusAssign(item: Collection<T>) { operator fun <T> Preference<Set<T>>.minusAssign(item: Collection<T>) {
get() - item set(get() - item)
} }
operator fun <T> Preference<Set<T>>.plusAssign(item: T) { operator fun <T> Preference<Set<T>>.plusAssign(item: T) {