File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
app/code/Magento/Theme/view/frontend Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 18
18
</div>
19
19
<!-- /ko -->
20
20
21
- <!-- ko if: messages().messages && messages().messages.length > 0 -->
22
21
<div aria-atomic="true" role="alert" class="messages" data-bind="foreach: {
23
22
data: messages().messages, as: 'message'
24
- }">
23
+ }, afterRender: purgeMessages ">
25
24
<div data-bind="attr: {
26
25
class: 'message-' + message.type + ' ' + message.type + ' message',
27
26
'data-ui-id': 'message-' + message.type
28
27
}">
29
28
<div data-bind="html: $parent.prepareMessageForHtml(message.text)"></div>
30
29
</div>
31
30
</div>
32
- <!-- /ko -->
33
31
</div>
32
+
34
33
<script type="text/x-magento-init">
35
34
{
36
35
"*": {
Original file line number Diff line number Diff line change @@ -44,11 +44,6 @@ define([
44
44
disposableCustomerData : 'messages'
45
45
} ) ;
46
46
47
- // Force to clean obsolete messages
48
- if ( ! _ . isEmpty ( this . messages ( ) . messages ) ) {
49
- customerData . set ( 'messages' , { } ) ;
50
- }
51
-
52
47
$ . mage . cookies . set ( 'mage-messages' , '' , {
53
48
samesite : 'strict' ,
54
49
domain : ''
@@ -63,6 +58,11 @@ define([
63
58
*/
64
59
prepareMessageForHtml : function ( message ) {
65
60
return escaper . escapeHtml ( message , this . allowedTags ) ;
61
+ } ,
62
+ purgeMessages : function ( ) {
63
+ if ( ! _ . isEmpty ( this . messages ( ) . messages ) ) {
64
+ customerData . set ( 'messages' , { } ) ;
65
+ }
66
66
}
67
67
} ) ;
68
68
} ) ;
You can’t perform that action at this time.
0 commit comments