Sindbad~EG File Manager

Current Path : /home/frekansk/.trash/wp-content/plugins/learnpress/assets/src/apps/js/admin/editor/actions/
Upload File :
Current File : /home/frekansk/.trash/wp-content/plugins/learnpress/assets/src/apps/js/admin/editor/actions/quiz.js

const Quiz = {
    heartbeat: function (context) {
        LP.Request({
                type: 'heartbeat'
            }
        )
            .then(
                function (response) {
                    var result = response.body;
                    context.commit('UPDATE_HEART_BEAT', !!result.success);
                },
                function (error) {
                    context.commit('UPDATE_HEART_BEAT', false);
                }
            );
    },

    newRequest: function (context) {
        context.commit('INCREASE_NUMBER_REQUEST');
        context.commit('UPDATE_STATUS', 'loading');

        window.onbeforeunload = function () {
            return '';
        }
    },

    requestCompleted: function (context, status) {
        context.commit('DECREASE_NUMBER_REQUEST');

        if (context.getters.currentRequest === 0) {
            context.commit('UPDATE_STATUS', status);
            window.onbeforeunload = null;
        }
    }
};

export default Quiz;

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists