From ad4c418736c5f81f28d2ecf50da5154fc812e1f7 Mon Sep 17 00:00:00 2001 From: tarsin Date: Wed, 31 May 2023 18:37:45 +0800 Subject: [PATCH] Resolve #1121 --- .../java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt index fbd3fce81..1869d8ad0 100755 --- a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt @@ -1525,7 +1525,7 @@ class GalleryDetailScene : BaseScene(), DownloadInfoListener { if (mArchiveList == null) { mErrorText!!.visibility = View.GONE mListView!!.visibility = View.GONE - lifecycleScope.launchIO { + mJob = lifecycleScope.launchIO { runSuspendCatching { EhEngine.getArchiveList(url!!, mGid, mToken) }.onSuccess { result -> @@ -1543,6 +1543,7 @@ class GalleryDetailScene : BaseScene(), DownloadInfoListener { mErrorText?.text = ExceptionUtils.getReadableString(it) } } + mJob = null } } else { bind(mArchiveList, mCurrentFunds) @@ -1611,7 +1612,7 @@ class GalleryDetailScene : BaseScene(), DownloadInfoListener { val res = mArchiveList!![position].res val isHAtH = mArchiveList!![position].isHAtH composeBindingGD?.run { - mJob = lifecycleScope.launchIO { + lifecycleScope.launchIO { runSuspendCatching { EhEngine.downloadArchive(gid, token, mArchiveFormParamOr, res, isHAtH) }.onSuccess { result -> @@ -1632,7 +1633,6 @@ class GalleryDetailScene : BaseScene(), DownloadInfoListener { showTip(R.string.download_archive_failure, LENGTH_LONG) } } - mJob = null } } }