Skip to content
Snippets Groups Projects
Unverified Commit a3d687ed authored by Christoph Wurst's avatar Christoph Wurst
Browse files

Fix initializing the editor mode


In the `data` of the Composer component we initialize the editor mode
with 'html' and update the mode as soon as the alias has been set (this
is done async). The uninitialized value is `-1` and not `undefined`,
hence before the patch the editor more always switch to `html` even when
the account was set to `plaintext`.

Signed-off-by: default avatarChristoph Wurst <christoph@winzerhof-wurst.at>
parent 7a48e8a1
No related branches found
No related tags found
No related merge requests found
......@@ -253,6 +253,8 @@ import NoDraftsMailboxConfiguredError
const debouncedSearch = debouncePromise(findRecipient, 500)
const NO_ALIAS_SET = -1
Vue.use(Autosize)
const STATES = Object.seal({
......@@ -323,7 +325,7 @@ export default {
data() {
return {
showCC: this.cc.length > 0,
selectedAlias: -1, // Fixed in `beforeMount`
selectedAlias: NO_ALIAS_SET, // Fixed in `beforeMount`
autocompleteRecipients: this.to.concat(this.cc).concat(this.bcc),
newRecipients: [],
subjectVal: this.subject,
......@@ -452,7 +454,7 @@ export default {
} else {
this.selectedAlias = this.aliases[0]
}
if (previous === undefined) {
if (previous === NO_ALIAS_SET) {
this.editorMode = this.selectedAlias.editorMode
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment