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