Files
objects/wco/privatri/privatri.js
2025-08-14 10:36:30 +02:00

25 lines
995 B
JavaScript

var apx = apx || {};
apx.privatri = {};
apx.privatri.loadwco = async (id, ctx) => {
// check if not authenticate, do nothing cause by default screensignin and wait authentification
// if authenticate, if url xhash then redirect if no url then change wco-link=screenmyworld
// if (dayjs(apx.data.headers.xdays).diff(dayjs(), "hours") >= 24) apx.apxauth.checkisauth();
//load main.mustache of the component
//when wco-xxx change it run this function
console.log(
`Load wconame:privatri apx.privatri.loadwco with id:${id} and ctx: ${JSON.stringify(
ctx
)}`
);
//refresh thread from BE
const threadlist = apx.privatri.getthread(apx.data.headers.xalias,1000000)
const tpldataname = `${apx.data.pagename}_${id}_privatri`;
const privatriid = document.getElementById(id);
privatriid.innerHTML = Mustache.render(apx.data.tpl.privatrimain, threadlist);
}
apx.privatri.getthread=async(alias,timestamp)=>{
//store in indexdb the thread
return true
}