Skip to content

Commit d81c5ed

Browse files
committed
Analysis: Resolve global scope delicate coroutines api warnings
Warning Message: "This is a delicate API and its use requires care. Make sure you fully read and understand documentation of the declaration that is marked as a delicate API." Adding the '@OptIn(DelicateCoroutinesApi::class)' annotation for the 'retrieveCapability(...)' function is the recommended action to resolve this 'GlobalScope' warning.
1 parent b12c5f2 commit d81c5ed

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

WordPress/src/main/java/org/wordpress/android/ui/posts/editor/XPostsCapabilityChecker.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.wordpress.android.ui.posts.editor
22

33
import androidx.core.util.Consumer
4+
import kotlinx.coroutines.DelicateCoroutinesApi
45
import kotlinx.coroutines.Dispatchers
56
import kotlinx.coroutines.GlobalScope
67
import kotlinx.coroutines.launch
@@ -13,6 +14,7 @@ class XPostsCapabilityChecker @Inject constructor(
1314
private val xPostsStore: XPostsStore
1415
) {
1516
@Suppress("GlobalCoroutineUsage")
17+
@OptIn(DelicateCoroutinesApi::class)
1618
fun retrieveCapability(site: SiteModel, callback: Consumer<Boolean>) {
1719
GlobalScope.launch(Dispatchers.IO) {
1820
val capability = isCapable(site)

0 commit comments

Comments
 (0)