Przeglądaj źródła

Don't warn on format change when campaign content is empty. Closes #634.

Kailash Nadh 3 lat temu
rodzic
commit
e982e6bb25
1 zmienionych plików z 7 dodań i 0 usunięć
  1. 7 0
      frontend/src/components/Editor.vue

+ 7 - 0
frontend/src/components/Editor.vue

@@ -252,6 +252,13 @@ export default {
     },
 
     onFormatChange(format) {
+      if (this.form.body.trim() === '') {
+        this.form.format = format;
+        this.onEditorChange();
+        return;
+      }
+
+      // Content isn't empty. Warn.
       this.$utils.confirm(
         this.$t('campaigns.confirmSwitchFormat'),
         () => {