From 84a51035266b5907deb4cd5e370e0a4b8d738b0c Mon Sep 17 00:00:00 2001 From: Kelvin Date: Thu, 5 Jun 2025 19:11:55 +0200 Subject: [PATCH] Use lifecycle scope instead of root scope --- .../fragment/mainactivity/main/SubscriptionsFeedFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/SubscriptionsFeedFragment.kt b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/SubscriptionsFeedFragment.kt index 83e39a88..4a3fdf91 100644 --- a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/SubscriptionsFeedFragment.kt +++ b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/SubscriptionsFeedFragment.kt @@ -191,7 +191,7 @@ class SubscriptionsFeedFragment : MainFragment() { private var _bypassRateLimit = false; private val _lastExceptions: List? = null; - private val _taskGetPager = TaskHandler>({StateApp.instance.scope}, { withRefresh -> + private val _taskGetPager = TaskHandler>({fragment.lifecycleScope}, { withRefresh -> val group = subGroup; if(!_bypassRateLimit) { val subRequestCounts = StateSubscriptions.instance.getSubscriptionRequestCount(group); @@ -202,7 +202,7 @@ class SubscriptionsFeedFragment : MainFragment() { throw RateLimitException(rateLimitPlugins.map { it.key.id }); } _bypassRateLimit = false; - val resp = StateSubscriptions.instance.getGlobalSubscriptionFeed(StateApp.instance.scope, withRefresh, group); + val resp = StateSubscriptions.instance.getGlobalSubscriptionFeed(fragment.lifecycleScope, withRefresh, group); val feed = StateSubscriptions.instance.getFeed(group?.id); val currentExs = feed?.exceptions ?: listOf();