From 4d7a1622907b4644c849b67f06c1aecbc2f6d1a4 Mon Sep 17 00:00:00 2001 From: trendschau Date: Thu, 1 Jul 2021 16:49:41 +0200 Subject: [PATCH] Version 1.4.7: Fix initial notice error --- system/author/js/vue-blox.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/system/author/js/vue-blox.js b/system/author/js/vue-blox.js index 3232827..a42f782 100644 --- a/system/author/js/vue-blox.js +++ b/system/author/js/vue-blox.js @@ -865,6 +865,13 @@ const noticeComponent = Vue.component('notice-component', { noticedown: function() { this.prefix = this.getNoticePrefix(this.compmarkdown); + + /* initially it is empty string, so we add it here if user clicks downgrade button */ + if(this.prefix == '') + { + this.prefix = '!'; + } + this.prefix = this.prefix + '!'; if(this.prefix.length > 3) { @@ -876,11 +883,16 @@ const noticeComponent = Vue.component('notice-component', { getNoticePrefix: function(str) { var prefix = ''; - for(var i = 0; i < str.length; i++){ + if(str === undefined) + { + return prefix; + } + for(var i = 0; i < str.length; i++) + { if(str[i] != '!'){ return prefix } prefix += '!'; } - return prefix; + return prefix; }, updatemarkdown: function(value) {