Skip to content

Commit

Permalink
fix: manga not reordering automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush2622 committed Nov 7, 2024
1 parent ffd9fec commit 0fa2cf9
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ import ani.dantotsu.media.Media
import ani.dantotsu.media.MediaDetailsViewModel
import ani.dantotsu.media.MediaNameAdapter
import ani.dantotsu.media.MediaSingleton
import ani.dantotsu.media.anime.ExoplayerView
import ani.dantotsu.media.anime.ExoplayerView.Companion
import ani.dantotsu.media.manga.MangaCache
import ani.dantotsu.media.manga.MangaChapter
import ani.dantotsu.others.ImageViewDialog
Expand Down Expand Up @@ -185,6 +187,17 @@ class MangaReaderActivity : AppCompatActivity() {
onBackPressedDispatcher.onBackPressed()
}

@Suppress("UNCHECKED_CAST")
val list = (PrefManager.getNullableCustomVal(
"continueMangaList",
listOf<Int>(),
List::class.java
) as List<Int>).toMutableList()
if (list.contains(media.id)) list.remove(media.id)
list.add(media.id)

PrefManager.setCustomVal("continueAnimeList", list)

defaultSettings = loadReaderSettings("reader_settings") ?: defaultSettings

onBackPressedDispatcher.addCallback(this) {
Expand Down

0 comments on commit 0fa2cf9

Please sign in to comment.