Skip to content

Commit c683f01

Browse files
committed
fix: Make call to LocalStorage.get async
1 parent 080b6a2 commit c683f01

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ $fetchCookies = !(bool)$block->getSkipCookies();
2424
fetchCookies: <?= /* @noEscape */ $fetchLocalStorage ? 'true' : 'false' ?>,
2525
init() {
2626
if (this.fetchLocalStorage) {
27-
Alpine.effect(() => {
28-
const messageSection = Alpine.store('LocalStorage').get('messages');
27+
Alpine.effect(async () => {
28+
const messageSection = await Alpine.store('LocalStorage').get('messages');
2929
if (messageSection && messageSection.messages) {
3030
this.messages = [...this.messages, ...messageSection.messages];
3131
this.reset();
@@ -86,8 +86,8 @@ $fetchCookies = !(bool)$block->getSkipCookies();
8686
messages: []
8787
});
8888
},
89-
getMessagesFromStore() {
90-
const messagesSection = this.getStore().get('messages');
89+
async getMessagesFromStore() {
90+
const messagesSection = await this.getStore().get('messages');
9191
return messagesSection && messagesSection.messages ? messagesSection.messages : [];
9292
},
9393
setMessageInStore(messages) {

0 commit comments

Comments
 (0)