diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.kt b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.kt index 62535baa3..9fa321d30 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.kt @@ -134,7 +134,7 @@ class AccountListFragment : Fragment(R.layout.fragment_account_list), AccountAct } override fun onMute(mute: Boolean, id: String, position: Int, notifications: Boolean) { - lifecycleScope.launch { + viewLifecycleOwner.lifecycleScope.launch { try { if (!mute) { api.unmuteAccount(id) @@ -180,7 +180,7 @@ class AccountListFragment : Fragment(R.layout.fragment_account_list), AccountAct } override fun onBlock(block: Boolean, id: String, position: Int) { - lifecycleScope.launch { + viewLifecycleOwner.lifecycleScope.launch { try { if (!block) { api.unblockAccount(id) @@ -290,7 +290,7 @@ class AccountListFragment : Fragment(R.layout.fragment_account_list), AccountAct binding.recyclerView.post { adapter.setBottomLoading(true) } } - lifecycleScope.launch { + viewLifecycleOwner.lifecycleScope.launch { try { val response = getFetchCallByListType(fromId) if (!response.isSuccessful) { @@ -307,8 +307,8 @@ class AccountListFragment : Fragment(R.layout.fragment_account_list), AccountAct val linkHeader = response.headers()["Link"] onFetchAccountsSuccess(accountList, linkHeader) - } catch (throwable: Throwable) { - onFetchAccountsFailure(throwable) + } catch (exception: IOException) { + onFetchAccountsFailure(exception) } } }