Skip to content

Commit bef2d8e

Browse files
committed
Use default main dispatcher instead of the one passed in the constructor
1 parent 6ce6c91 commit bef2d8e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

media-placeholders/src/main/java/org/wordpress/aztec/placeholders/PlaceholderManager.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import android.view.View
1212
import android.view.ViewTreeObserver
1313
import android.widget.FrameLayout
1414
import androidx.core.content.ContextCompat
15-
import kotlinx.coroutines.CoroutineDispatcher
1615
import kotlinx.coroutines.CoroutineScope
16+
import kotlinx.coroutines.Dispatchers
1717
import kotlinx.coroutines.Job
1818
import kotlinx.coroutines.launch
1919
import kotlinx.coroutines.runBlocking
@@ -39,7 +39,6 @@ import kotlin.math.min
3939
class PlaceholderManager(
4040
private val aztecText: AztecText,
4141
private val container: FrameLayout,
42-
private val mainThreadDispatcher: CoroutineDispatcher,
4342
private val htmlTag: String = DEFAULT_HTML_TAG
4443
) : AztecContentChangeWatcher.AztecTextChangeObserver,
4544
IHtmlTagHandler,
@@ -51,7 +50,7 @@ class PlaceholderManager(
5150
private val positionToId = mutableSetOf<Placeholder>()
5251
private val job = Job()
5352
override val coroutineContext: CoroutineContext
54-
get() = mainThreadDispatcher + job
53+
get() = Dispatchers.Main + job
5554

5655
init {
5756
aztecText.setOnVisibilityChangeListener(this)

0 commit comments

Comments
 (0)