0

Hi i have extended the messages.js by adding the following code

define([
'jquery',
'uiComponent',
'Magento_Customer/js/customer-data',
'underscore',
'jquery/jquery-storageapi'
], function ($, Component, customerData, _) {
'use strict';

return Component.extend({
    defaults: {
        cookieMessages: [],
        messages: []
    },

    /**
     * Extends Component object by storage observable messages.
     */
    initialize: function () {
        this._super();

        this.cookieMessages = $.cookieStorage.get('mage-messages');
        this.messages = customerData.get('messages').extend({
            disposableCustomerData: 'messages'
        });

        // Force to clean obsolete messages
        if (!_.isEmpty(this.messages().messages)) {
            customerData.set('messages', {});
        }

        $.cookieStorage.set('mage-messages', '');

        setTimeout(function() {
            $(".messages").hide('blind', {}, 900)
        }, 9000);           
    }
});

});

No messages are showing up after adding the above jquery in messages.js

Please help me in fixing the above issue.

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.