1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00
appwrite/public/scripts/init.js
2019-08-20 13:10:32 +03:00

19 lines
483 B
JavaScript

// Init
window.ls.error = function () {
return function (error) {
console.error('ERROR-APP', error);
}
};
window.addEventListener('error', function (event) {
console.error('ERROR-EVENT:', event.error.message, event.error.stack);
});
document.addEventListener('logout', function () {
window.location = '/auth/signin';
});
document.addEventListener('http-get-401', function() { /* on error */
document.dispatchEvent(new CustomEvent('logout'));
}, true);