Draft : introduce DraftService and start using it.
This commit is contained in:
parent
d1e11f5c33
commit
f821fa5862
11 changed files with 198 additions and 3 deletions
|
|
@ -16,4 +16,6 @@
|
|||
|
||||
package io.element.android.libraries.di
|
||||
|
||||
abstract class RoomScope private constructor()
|
||||
abstract class RoomScope private constructor(
|
||||
|
||||
)
|
||||
|
|
|
|||
|
|
@ -618,7 +618,7 @@ class RustMatrixRoom(
|
|||
}
|
||||
|
||||
override suspend fun clearComposerDraft(): Result<Unit> = runCatching {
|
||||
Timber.d("clearComposerDraft: for $roomId")
|
||||
Timber.d("clearComposerDraft for $roomId")
|
||||
innerRoom.clearComposerDraft()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,20 @@ sealed interface TextEditorState {
|
|||
is Rich -> richTextEditorState.hasFocus
|
||||
}
|
||||
|
||||
suspend fun setHtml(html: String) {
|
||||
when (this) {
|
||||
is Markdown -> Unit
|
||||
is Rich -> richTextEditorState.setHtml(html)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun setMarkdown(text: String) {
|
||||
when (this) {
|
||||
is Markdown -> state.text.update(text, true)
|
||||
is Rich -> richTextEditorState.setMarkdown(text)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun reset() {
|
||||
when (this) {
|
||||
is Markdown -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue