Skip to content

Commit

Permalink
Add missing subscribedStates personnalisation to HtmlReloader
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Jun 21, 2024
1 parent 48d01b0 commit e5c9609
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ class EditorReloader(private val coroutineScope: CoroutineScope) {
*
* @throws IllegalStateException If the method is not called on the main thread.
*/
suspend fun load(editor: RichHtmlEditorWebView, defaultHtml: String) {
suspend fun load(editor: RichHtmlEditorWebView, defaultHtml: String, subscribedStates: Set<StatusCommand>? = null) {
if (Looper.myLooper() != Looper.getMainLooper()) error("The load method needs to be called on the main thread")

if (needToReloadHtml) {
savedHtml.collectLatest {
if (it == null) return@collectLatest

resetSavedHtml()
editor.setHtml(it)
editor.setHtml(it, subscribedStates)
}
} else {
editor.setHtml(defaultHtml)
Expand Down

0 comments on commit e5c9609

Please sign in to comment.