From 171db639ffc8e79aac8d8d8e6a354f8d703a387c Mon Sep 17 00:00:00 2001 From: Two-Ai <81279822+Two-Ai@users.noreply.github.com> Date: Sun, 11 Dec 2022 16:12:41 -0500 Subject: [PATCH] Fix SetMangaViewerFlags (#8719) Stop clearing old viewer flags when setting a flag --- .../kanade/domain/manga/interactor/SetMangaViewerFlags.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/SetMangaViewerFlags.kt b/app/src/main/java/eu/kanade/domain/manga/interactor/SetMangaViewerFlags.kt index a9f743a11b..5673cdbc12 100644 --- a/app/src/main/java/eu/kanade/domain/manga/interactor/SetMangaViewerFlags.kt +++ b/app/src/main/java/eu/kanade/domain/manga/interactor/SetMangaViewerFlags.kt @@ -10,19 +10,21 @@ class SetMangaViewerFlags( ) { suspend fun awaitSetMangaReadingMode(id: Long, flag: Long) { + val manga = mangaRepository.getMangaById(id) mangaRepository.update( MangaUpdate( id = id, - viewerFlags = flag.setFlag(flag, ReadingModeType.MASK.toLong()), + viewerFlags = manga.viewerFlags.setFlag(flag, ReadingModeType.MASK.toLong()), ), ) } suspend fun awaitSetOrientationType(id: Long, flag: Long) { + val manga = mangaRepository.getMangaById(id) mangaRepository.update( MangaUpdate( id = id, - viewerFlags = flag.setFlag(flag, OrientationType.MASK.toLong()), + viewerFlags = manga.viewerFlags.setFlag(flag, OrientationType.MASK.toLong()), ), ) }