mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Draft : introduce DraftService and start using it.
This commit is contained in:
+14
@@ -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 -> {
|
||||
|
||||
Reference in New Issue
Block a user