Skip to content

Commit 862b0bb

Browse files
committed
Always use get('messages') when retrieving message section from store
1 parent 079cdba commit 862b0bb

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

view/frontend/templates/script/store/message-store.phtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use Magento\Framework\View\Element\Template;
1111
messages: [],
1212
init() {
1313
Alpine.effect(() => {
14-
const storeData = Alpine.store('LokiLocalStorage').data;
15-
if (storeData && storeData.messages && storeData.messages.messages) {
16-
this.messages = [...this.messages, ...storeData.messages.messages];
14+
const messageSection = Alpine.store('LokiLocalStorage').get('messages');
15+
if (messageSection && messageSection.messages) {
16+
this.messages = [...this.messages, ...messageSection.messages];
1717
this.getStore().set('messages', {messages: []});
1818
}
1919
});
@@ -54,11 +54,11 @@ use Magento\Framework\View\Element\Template;
5454
this.getStore().remove('messages');
5555
},
5656
getMessagesFromStore() {
57-
const messagesSection = this.getStore().data.messages;
57+
const messagesSection = this.getStore().get('messages');
5858
return messagesSection && messagesSection.messages ? messagesSection.messages : [];
5959
},
6060
setMessageInStore(messages) {
61-
const messagesSection = this.getStore().data.messages;
61+
const messagesSection = this.getStore().get('messages');
6262
messagesSection.messages = messages;
6363
this.getStore().set('messages', messagesSection);
6464
},

0 commit comments

Comments
 (0)