/*eslint no-undef:0*/ /*eslint-env browser*/ "use strict"; var apx = apx || {}; /** * Js lib to interact with apxtrib backend * * html page must have apxlocal with at least headers key * ' ); return; } if (document.querySelector("html").getAttribute("lang")) { apxlocal.headers.xlang = document .querySelector("html") .getAttribute("lang"); } if (localStorage.getItem(apxlocal.headers.xapp)) { apx.data = JSON.parse(localStorage.getItem(apxlocal.headers.xapp)); if (apx.data.headers.xtribe != apxlocal.headers.xtribe) { // if an app change of tribe localStorage.removeItem(apxlocal.headers.xapp); delete apx.data; } } if (!apx.data) { apx.data = apxlocal; } console.log("apx.data", apx.data); apx.save(); }; apx.ready(apx.update);