File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
app/code/Magento/Theme/view/frontend/web/js/view Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -57,16 +57,27 @@ define([
57
57
* @return {String }
58
58
*/
59
59
prepareMessageForHtml : function ( message ) {
60
+ this . removeMessage ( message ) ;
61
+
62
+ return escaper . escapeHtml ( message , this . allowedTags ) ;
63
+ } ,
64
+
65
+ /**
66
+ * Remove provided message from message queue
67
+ *
68
+ * @param message
69
+ */
70
+ removeMessage : function ( message ) {
60
71
if ( ! _ . isEmpty ( this . messages ( ) . messages ) ) {
61
- let messages = [ ] ;
72
+ let messages = [ ] ;
73
+
62
74
for ( let i = 0 ; i < this . messages ( ) . messages . length ; i ++ ) {
63
75
if ( this . messages ( ) . messages [ i ] !== message ) {
64
76
messages . push ( this . messages ( ) . messages [ i ] ) ;
65
77
}
66
78
}
67
79
customerData . set ( 'messages' , messages ) ;
68
80
}
69
- return escaper . escapeHtml ( message , this . allowedTags ) ;
70
81
}
71
82
} ) ;
72
83
} ) ;
You can’t perform that action at this time.
0 commit comments