adding application and open task view for applicants
This commit is contained in:
parent
f08bafc079
commit
ab50b66e7d
@ -760,7 +760,7 @@ const render = {
|
||||
<h4>${title}</h4>
|
||||
<sl-relative-time date=${date}></sl-relative-time>
|
||||
<p>${description}</p>
|
||||
<ul class="flex gap-0-5 flex-wrap">
|
||||
<ul class="flex gap-0-3 flex-wrap">
|
||||
<li>${floGlobals.taskCategories[category]}</li>
|
||||
${deadline ? html`<li>Complete <sl-relative-time date=${deadline}></sl-relative-time></li>` : ''}
|
||||
</ul>
|
||||
@ -770,11 +770,19 @@ const render = {
|
||||
</li>
|
||||
`
|
||||
},
|
||||
availableTasks(target = 'available_tasks_list') {
|
||||
availableTasks(options = {}) {
|
||||
const { type } = options
|
||||
if ((floGlobals.appObjects?.rmInterns.tasks || []).length === 0)
|
||||
return renderElem(getRef(target), html`<p>No tasks available</p>`);
|
||||
const tasksList = floGlobals.appObjects.rmInterns.tasks.map(render.task);
|
||||
renderElem(getRef(target), html`${tasksList}`)
|
||||
return renderElem(getRef('available_tasks_list'), html`<p>No tasks available</p>`);
|
||||
let tasksList = floGlobals.appObjects.rmInterns.tasks;
|
||||
if (type) {
|
||||
if (type === 'applications')
|
||||
tasksList = tasksList.filter(task => floGlobals.applications.has(task.id))
|
||||
else if (type === 'available')
|
||||
tasksList = tasksList.filter(task => !floGlobals.applications.has(task.id))
|
||||
}
|
||||
tasksList = tasksList.map(render.task);
|
||||
renderElem(getRef('available_tasks_list'), html`${tasksList}`)
|
||||
}
|
||||
}
|
||||
|
||||
@ -933,10 +941,10 @@ router.addRoute('', renderHome)
|
||||
router.addRoute('home', renderHome)
|
||||
|
||||
function renderHome(state) {
|
||||
const { } = state;
|
||||
if (floGlobals.isAdmin) {
|
||||
|
||||
} else if (floGlobals.isSubAdmin) {
|
||||
const { } = state;
|
||||
renderElem(getRef('app_body'), html`
|
||||
<article id="home">
|
||||
${header()}
|
||||
@ -957,6 +965,7 @@ function renderHome(state) {
|
||||
getRef('task_popup__title').textContent = 'Add Task';
|
||||
render.availableTasks()
|
||||
} else {
|
||||
const { params: { view = floGlobals.applications?.size ? 'applications' : 'available' } } = state;
|
||||
if (floGlobals.applyingForTask) {
|
||||
applyToTask(floGlobals.applyingForTask)
|
||||
floGlobals.applyingForTask = null;
|
||||
@ -967,7 +976,14 @@ function renderHome(state) {
|
||||
<section class="grid gap-1">
|
||||
<h2>Home</h2>
|
||||
<div class="flex flex-direction-column gap-1-5">
|
||||
<h4>Available</h4>
|
||||
${floGlobals.applications?.size > 0 ? html`
|
||||
<sm-chips class="margin-right-auto" onchange=${handleViewChange}>
|
||||
<sm-chip value="applications" ?selected=${view === 'applications'}>${floGlobals.applications.size} applications</sm-chip>
|
||||
<sm-chip value="available" ?selected=${view === 'available'}>${floGlobals.appObjects.rmInterns.tasks.length - floGlobals.applications.size} Available</sm-chip>
|
||||
</sm-chips>
|
||||
` : html`
|
||||
<h4>Available</h4>
|
||||
`}
|
||||
<ul id="available_tasks_list" class="grid">
|
||||
<sm-spinner></sm-spinner>
|
||||
</ul>
|
||||
@ -975,10 +991,13 @@ function renderHome(state) {
|
||||
</section>
|
||||
</article>
|
||||
`)
|
||||
render.availableTasks()
|
||||
render.availableTasks({ type: view })
|
||||
}
|
||||
}
|
||||
}
|
||||
function handleViewChange(e) {
|
||||
location.hash = `#/home?view=${e.target.value}`
|
||||
}
|
||||
|
||||
router.addRoute('task', (state) => {
|
||||
const { params: { id } } = state;
|
||||
@ -1203,7 +1222,9 @@ window.addEventListener("load", () => {
|
||||
const taskApplications = floDapps.getNextGeneralData('taskApplications', '0');
|
||||
for (const application in taskApplications) {
|
||||
const { message: { taskID } } = taskApplications[application];
|
||||
floGlobals.applications.add(taskID)
|
||||
if ((floGlobals.appObjects.rmInterns.tasks || []).some(task => task.id === taskID)) {
|
||||
floGlobals.applications.add(taskID)
|
||||
}
|
||||
}
|
||||
const userProfile = floDapps.getNextGeneralData('userProfile', '0');
|
||||
floGlobals.userProfile = Object.values(userProfile).at(-1)?.message.encryptedData;
|
||||
|
||||
21
scripts/app.min.js
vendored
21
scripts/app.min.js
vendored
@ -9,7 +9,7 @@ const uiGlobals={},{html:html,svg:svg,render:renderElem}=uhtml;function getRef(e
|
||||
<h4>${title}</h4>
|
||||
<sl-relative-time date=${date}></sl-relative-time>
|
||||
<p>${description}</p>
|
||||
<ul class="flex gap-0-5 flex-wrap">
|
||||
<ul class="flex gap-0-3 flex-wrap">
|
||||
<li>${floGlobals.taskCategories[category]}</li>
|
||||
${deadline?html`<li>Complete <sl-relative-time date=${deadline}></sl-relative-time></li>`:""}
|
||||
</ul>
|
||||
@ -17,7 +17,7 @@ const uiGlobals={},{html:html,svg:svg,render:renderElem}=uhtml;function getRef(e
|
||||
${actions}
|
||||
</div>
|
||||
</li>
|
||||
`},availableTasks(target="available_tasks_list"){if(0===(floGlobals.appObjects?.rmInterns.tasks||[]).length)return renderElem(getRef(target),html`<p>No tasks available</p>`);const tasksList=floGlobals.appObjects.rmInterns.tasks.map(render.task);renderElem(getRef(target),html`${tasksList}`)}},router=new Router({routingStart(state){"scrollRestoration"in history&&(history.scrollRestoration="manual"),window.scrollTo(0,0)},routingEnd(state){const{page:page,lastPage:lastPage}=state;lastPage!==page&&closePopup()}}),header=()=>{const{page:page}=router.state,isUserLoggedIn="loading"===page||floGlobals.isUserLoggedIn;return html`
|
||||
`},availableTasks(options={}){const{type:type}=options;if(0===(floGlobals.appObjects?.rmInterns.tasks||[]).length)return renderElem(getRef("available_tasks_list"),html`<p>No tasks available</p>`);let tasksList=floGlobals.appObjects.rmInterns.tasks;type&&("applications"===type?tasksList=tasksList.filter((task=>floGlobals.applications.has(task.id))):"available"===type&&(tasksList=tasksList.filter((task=>!floGlobals.applications.has(task.id))))),tasksList=tasksList.map(render.task),renderElem(getRef("available_tasks_list"),html`${tasksList}`)}},router=new Router({routingStart(state){"scrollRestoration"in history&&(history.scrollRestoration="manual"),window.scrollTo(0,0)},routingEnd(state){const{page:page,lastPage:lastPage}=state;lastPage!==page&&closePopup()}}),header=()=>{const{page:page}=router.state,isUserLoggedIn="loading"===page||floGlobals.isUserLoggedIn;return html`
|
||||
<header id="main_header" class="flex align-center gap-1">
|
||||
<a href="#/">
|
||||
<svg id="main_logo" class="icon" viewBox="0 0 27.25 32"> <title>RanchiMall</title> <path d="M27.14,30.86c-.74-2.48-3-4.36-8.25-6.94a20,20,0,0,1-4.2-2.49,6,6,0,0,1-1.25-1.67,4,4,0,0,1,0-2.26c.37-1.08.79-1.57,3.89-4.55a11.66,11.66,0,0,0,3.34-4.67,6.54,6.54,0,0,0,.05-2.82C20,3.6,18.58,2,16.16.49c-.89-.56-1.29-.64-1.3-.24a3,3,0,0,1-.3.72l-.3.55L13.42.94C13,.62,12.4.26,12.19.15c-.4-.2-.73-.18-.72.05a9.39,9.39,0,0,1-.61,1.33s-.14,0-.27-.13C8.76.09,8-.27,8,.23A11.73,11.73,0,0,1,6.76,2.6C4.81,5.87,2.83,7.49.77,7.49c-.89,0-.88,0-.61,1,.22.85.33.92,1.09.69A5.29,5.29,0,0,0,3,8.33c.23-.17.45-.29.49-.26a2,2,0,0,1,.22.63A1.31,1.31,0,0,0,4,9.34a5.62,5.62,0,0,0,2.27-.87L7,8l.13.55c.19.74.32.82,1,.65a7.06,7.06,0,0,0,3.46-2.47l.6-.71-.06.64c-.17,1.63-1.3,3.42-3.39,5.42L6.73,14c-3.21,3.06-3,5.59.6,8a46.77,46.77,0,0,0,4.6,2.41c.28.13,1,.52,1.59.87,3.31,2,4.95,3.92,4.95,5.93a2.49,2.49,0,0,0,.07.77h0c.09.09,0,.1.9-.14a2.61,2.61,0,0,0,.83-.32,3.69,3.69,0,0,0-.55-1.83A11.14,11.14,0,0,0,17,26.81a35.7,35.7,0,0,0-5.1-2.91C9.37,22.64,8.38,22,7.52,21.17a3.53,3.53,0,0,1-1.18-2.48c0-1.38.71-2.58,2.5-4.23,2.84-2.6,3.92-3.91,4.67-5.65a3.64,3.64,0,0,0,.42-2A3.37,3.37,0,0,0,13.61,5l-.32-.74.29-.48c.17-.27.37-.63.46-.8l.15-.3.44.64a5.92,5.92,0,0,1,1,2.81,5.86,5.86,0,0,1-.42,1.94c0,.12-.12.3-.15.4a9.49,9.49,0,0,1-.67,1.1,28,28,0,0,1-4,4.29C8.62,15.49,8.05,16.44,8,17.78a3.28,3.28,0,0,0,1.11,2.76c.95,1,2.07,1.74,5.25,3.32,3.64,1.82,5.22,2.9,6.41,4.38A4.78,4.78,0,0,1,21.94,31a3.21,3.21,0,0,0,.14.92,1.06,1.06,0,0,0,.43-.05l.83-.22.46-.12-.06-.46c-.21-1.53-1.62-3.25-3.94-4.8a37.57,37.57,0,0,0-5.22-2.82A13.36,13.36,0,0,1,11,21.19a3.36,3.36,0,0,1-.8-4.19c.41-.85.83-1.31,3.77-4.15,2.39-2.31,3.43-4.13,3.43-6a5.85,5.85,0,0,0-2.08-4.29c-.23-.21-.44-.43-.65-.65A2.5,2.5,0,0,1,15.27.69a10.6,10.6,0,0,1,2.91,2.78A4.16,4.16,0,0,1,19,6.16a4.91,4.91,0,0,1-.87,3c-.71,1.22-1.26,1.82-4.27,4.67a9.47,9.47,0,0,0-2.07,2.6,2.76,2.76,0,0,0-.33,1.54,2.76,2.76,0,0,0,.29,1.47c.57,1.21,2.23,2.55,4.65,3.73a32.41,32.41,0,0,1,5.82,3.24c2.16,1.6,3.2,3.16,3.2,4.8a1.94,1.94,0,0,0,.09.76,4.54,4.54,0,0,0,1.66-.4C27.29,31.42,27.29,31.37,27.14,30.86ZM6.1,7h0a3.77,3.77,0,0,1-1.46.45L4,7.51l.68-.83a25.09,25.09,0,0,0,3-4.82A12,12,0,0,1,8.28.76c.11-.12.77.32,1.53,1l.63.58-.57.84A10.34,10.34,0,0,1,6.1,7Zm5.71-1.78A9.77,9.77,0,0,1,9.24,7.18h0a5.25,5.25,0,0,1-1.17.28l-.58,0,.65-.78a21.29,21.29,0,0,0,2.1-3.12c.22-.41.42-.76.44-.79s.5.43.9,1.24L12,5ZM13.41,3a2.84,2.84,0,0,1-.45.64,11,11,0,0,1-.9-.91l-.84-.9.19-.45c.34-.79.39-.8,1-.31A9.4,9.4,0,0,1,13.8,2.33q-.18.34-.39.69Z"></path> </svg>
|
||||
@ -30,7 +30,7 @@ const uiGlobals={},{html:html,svg:svg,render:renderElem}=uhtml;function getRef(e
|
||||
</div>
|
||||
`}
|
||||
</header>
|
||||
`};function handleSignIn(){privKeyResolver(getRef("private_key_field").value.trim()),router.routeTo("loading")}function handleSignUp(){const privKey=getRef("generated_private_key").value.trim();privKeyResolver(privKey),router.routeTo("loading")}function handleSubAdminViewChange(e){location.hash=`#/home?view=${e.target.value}`}function renderHome(state){const{}=state;floGlobals.isAdmin||(floGlobals.isSubAdmin?(renderElem(getRef("app_body"),html`
|
||||
`};function handleSignIn(){privKeyResolver(getRef("private_key_field").value.trim()),router.routeTo("loading")}function handleSignUp(){const privKey=getRef("generated_private_key").value.trim();privKeyResolver(privKey),router.routeTo("loading")}function handleSubAdminViewChange(e){location.hash=`#/home?view=${e.target.value}`}function renderHome(state){if(floGlobals.isAdmin);else if(floGlobals.isSubAdmin){const{}=state;renderElem(getRef("app_body"),html`
|
||||
<article id="home">
|
||||
${header()}
|
||||
<section class="grid gap-1">
|
||||
@ -46,20 +46,27 @@ const uiGlobals={},{html:html,svg:svg,render:renderElem}=uhtml;function getRef(e
|
||||
</ul>
|
||||
</section>
|
||||
</article>
|
||||
`),getRef("task_popup__title").textContent="Add Task",render.availableTasks()):floGlobals.applyingForTask?(applyToTask(floGlobals.applyingForTask),floGlobals.applyingForTask=null):(renderElem(getRef("app_body"),html`
|
||||
`),getRef("task_popup__title").textContent="Add Task",render.availableTasks()}else{const{params:{view:view=(floGlobals.applications?.size?"applications":"available")}}=state;floGlobals.applyingForTask?(applyToTask(floGlobals.applyingForTask),floGlobals.applyingForTask=null):(renderElem(getRef("app_body"),html`
|
||||
<article id="home">
|
||||
${header()}
|
||||
<section class="grid gap-1">
|
||||
<h2>Home</h2>
|
||||
<div class="flex flex-direction-column gap-1-5">
|
||||
<h4>Available</h4>
|
||||
${floGlobals.applications?.size>0?html`
|
||||
<sm-chips class="margin-right-auto" onchange=${handleViewChange}>
|
||||
<sm-chip value="applications" ?selected=${"applications"===view}>${floGlobals.applications.size} applications</sm-chip>
|
||||
<sm-chip value="available" ?selected=${"available"===view}>${floGlobals.appObjects.rmInterns.tasks.length-floGlobals.applications.size} Available</sm-chip>
|
||||
</sm-chips>
|
||||
`:html`
|
||||
<h4>Available</h4>
|
||||
`}
|
||||
<ul id="available_tasks_list" class="grid">
|
||||
<sm-spinner></sm-spinner>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
`),render.availableTasks()))}router.addRoute("loading",(state=>{renderElem(getRef("app_body"),html`
|
||||
`),render.availableTasks({type:view}))}}function handleViewChange(e){location.hash=`#/home?view=${e.target.value}`}router.addRoute("loading",(state=>{renderElem(getRef("app_body"),html`
|
||||
<article id="loading">
|
||||
${header()}
|
||||
<section class="grid justify-content-center">
|
||||
@ -199,4 +206,4 @@ const uiGlobals={},{html:html,svg:svg,render:renderElem}=uhtml;function getRef(e
|
||||
<h1>404</h1>
|
||||
<h4>Page not found</h4>
|
||||
</article>
|
||||
`)}));let privKeyResolver=null;function getSignedIn(passwordType){return new Promise(((resolve,reject)=>{privKeyResolver=resolve;try{getPromptInput("Enter password","",{isPassword:!0}).then((password=>{password&&resolve(password)}))}catch(err){floGlobals.isPrivKeySecured="PIN/Password"===passwordType,["#/landing","#/sign_in","#/sign_up"].some((route=>window.location.hash.includes(route)))||(history.replaceState(null,null,"#/landing"),router.routeTo("#/landing"))}}))}function setSecurePassword(){if(!floGlobals.isPrivKeySecured){const password=getRef("secure_pwd_input").value.trim();floDapps.securePrivKey(password).then((()=>{floGlobals.isPrivKeySecured=!0,notify("Password set successfully","success"),closePopup()})).catch((err=>{notify(err,"error")}))}}function signOut(){getConfirmation("Sign out?",{message:"You are about to sign out of the app, continue?",confirmText:"Leave",cancelText:"Stay"}).then((async res=>{res&&(await floDapps.clearCredentials(),location.reload())}))}const btcAddresses={},floAddresses={};function getBtcAddress(floAddress){return btcAddresses[floAddress]||(btcAddresses[floAddress]=btcOperator.convert.legacy2bech(floAddress)),btcAddresses[floAddress]}function getFloAddress(btcAddress){return floAddresses[btcAddress]||(floAddresses[btcAddress]=floCrypto.toFloID(btcAddress)),floAddresses[btcAddress]}router.routeTo("loading"),window.addEventListener("load",(()=>{const[browserName,browserVersion]=detectBrowser().split(" "),supportedVersions={Chrome:85,Firefox:75,Safari:13};browserName in supportedVersions?parseInt(browserVersion)<supportedVersions[browserName]&¬ify(`${browserName} ${browserVersion} is not fully supported, some features may not work properly. Please update to ${supportedVersions[browserName]} or higher.`,"error"):notify("Browser is not fully compatible, some features may not work. for best experience please use Chrome, Edge, Firefox or Safari","error"),document.body.classList.remove("hidden"),document.addEventListener("keyup",(e=>{"Escape"===e.key&&closePopup()})),document.addEventListener("copy",(()=>{notify("copied","success")})),document.addEventListener("pointerdown",(e=>{e.target.closest("button:not(:disabled), .interactive:not(:disabled)")&&createRipple(e,e.target.closest("button, .interactive"))})),floDapps.setMidStartup((()=>new Promise(((resolve,reject)=>{floCloudAPI.requestObjectData("rmInterns").then((()=>{["#/landing","#/sign_in","#/sign_up"].some((route=>window.location.hash.includes(route)))&&router.routeTo(window.location.hash),resolve()})).catch((err=>{console.error(err),reject()}))})))),floDapps.setCustomPrivKeyInput(getSignedIn),floDapps.launchStartUp().then((async result=>{console.log(result),floGlobals.isUserLoggedIn=!0,floGlobals.myFloID=getFloAddress(floDapps.user.id),floGlobals.myBtcID=getBtcAddress(floGlobals.myFloID),floGlobals.isSubAdmin=floGlobals.subAdmins.includes(floGlobals.myFloID),floGlobals.isAdmin=floGlobals.myFloID===floGlobals.adminID;try{if(floGlobals.isSubAdmin){const promises=[];floGlobals.appObjects.rmInterns||(console.log("rmInterns not found, resetting"),floGlobals.appObjects.rmInterns={tasks:[]},promises.push(floCloudAPI.resetObjectData("rmInterns"))),promises.push(floCloudAPI.requestGeneralData("taskApplications")),await Promise.all(promises);const taskApplications=floDapps.getNextGeneralData("taskApplications","0");floGlobals.applications={};for(const application in taskApplications){const{message:{taskID:taskID},senderID:senderID}=taskApplications[application];floGlobals.applications[taskID]||(floGlobals.applications[taskID]=new Set),floGlobals.applications[taskID].add(senderID)}}else if(floGlobals.isAdmin);else{floGlobals.applications=new Set;const promises=[floCloudAPI.requestGeneralData("taskApplications",{senderID:[floGlobals.myFloID,floGlobals.myBtcID]}),floCloudAPI.requestGeneralData("userProfile",{senderID:[floGlobals.myFloID,floGlobals.myBtcID]})];await Promise.all(promises);const taskApplications=floDapps.getNextGeneralData("taskApplications","0");for(const application in taskApplications){const{message:{taskID:taskID}}=taskApplications[application];floGlobals.applications.add(taskID)}const userProfile=floDapps.getNextGeneralData("userProfile","0");floGlobals.userProfile=Object.values(userProfile).at(-1)?.message.encryptedData}["#/landing","#/sign_in","#/sign_up"].includes(window.location.hash)?(history.replaceState(null,null,"#/home"),router.routeTo("home")):router.routeTo(window.location.hash)}catch(err){console.error(err)}})).catch((error=>console.error(error)))}));
|
||||
`)}));let privKeyResolver=null;function getSignedIn(passwordType){return new Promise(((resolve,reject)=>{privKeyResolver=resolve;try{getPromptInput("Enter password","",{isPassword:!0}).then((password=>{password&&resolve(password)}))}catch(err){floGlobals.isPrivKeySecured="PIN/Password"===passwordType,["#/landing","#/sign_in","#/sign_up"].some((route=>window.location.hash.includes(route)))||(history.replaceState(null,null,"#/landing"),router.routeTo("#/landing"))}}))}function setSecurePassword(){if(!floGlobals.isPrivKeySecured){const password=getRef("secure_pwd_input").value.trim();floDapps.securePrivKey(password).then((()=>{floGlobals.isPrivKeySecured=!0,notify("Password set successfully","success"),closePopup()})).catch((err=>{notify(err,"error")}))}}function signOut(){getConfirmation("Sign out?",{message:"You are about to sign out of the app, continue?",confirmText:"Leave",cancelText:"Stay"}).then((async res=>{res&&(await floDapps.clearCredentials(),location.reload())}))}const btcAddresses={},floAddresses={};function getBtcAddress(floAddress){return btcAddresses[floAddress]||(btcAddresses[floAddress]=btcOperator.convert.legacy2bech(floAddress)),btcAddresses[floAddress]}function getFloAddress(btcAddress){return floAddresses[btcAddress]||(floAddresses[btcAddress]=floCrypto.toFloID(btcAddress)),floAddresses[btcAddress]}router.routeTo("loading"),window.addEventListener("load",(()=>{const[browserName,browserVersion]=detectBrowser().split(" "),supportedVersions={Chrome:85,Firefox:75,Safari:13};browserName in supportedVersions?parseInt(browserVersion)<supportedVersions[browserName]&¬ify(`${browserName} ${browserVersion} is not fully supported, some features may not work properly. Please update to ${supportedVersions[browserName]} or higher.`,"error"):notify("Browser is not fully compatible, some features may not work. for best experience please use Chrome, Edge, Firefox or Safari","error"),document.body.classList.remove("hidden"),document.addEventListener("keyup",(e=>{"Escape"===e.key&&closePopup()})),document.addEventListener("copy",(()=>{notify("copied","success")})),document.addEventListener("pointerdown",(e=>{e.target.closest("button:not(:disabled), .interactive:not(:disabled)")&&createRipple(e,e.target.closest("button, .interactive"))})),floDapps.setMidStartup((()=>new Promise(((resolve,reject)=>{floCloudAPI.requestObjectData("rmInterns").then((()=>{["#/landing","#/sign_in","#/sign_up"].some((route=>window.location.hash.includes(route)))&&router.routeTo(window.location.hash),resolve()})).catch((err=>{console.error(err),reject()}))})))),floDapps.setCustomPrivKeyInput(getSignedIn),floDapps.launchStartUp().then((async result=>{console.log(result),floGlobals.isUserLoggedIn=!0,floGlobals.myFloID=getFloAddress(floDapps.user.id),floGlobals.myBtcID=getBtcAddress(floGlobals.myFloID),floGlobals.isSubAdmin=floGlobals.subAdmins.includes(floGlobals.myFloID),floGlobals.isAdmin=floGlobals.myFloID===floGlobals.adminID;try{if(floGlobals.isSubAdmin){const promises=[];floGlobals.appObjects.rmInterns||(console.log("rmInterns not found, resetting"),floGlobals.appObjects.rmInterns={tasks:[]},promises.push(floCloudAPI.resetObjectData("rmInterns"))),promises.push(floCloudAPI.requestGeneralData("taskApplications")),await Promise.all(promises);const taskApplications=floDapps.getNextGeneralData("taskApplications","0");floGlobals.applications={};for(const application in taskApplications){const{message:{taskID:taskID},senderID:senderID}=taskApplications[application];floGlobals.applications[taskID]||(floGlobals.applications[taskID]=new Set),floGlobals.applications[taskID].add(senderID)}}else if(floGlobals.isAdmin);else{floGlobals.applications=new Set;const promises=[floCloudAPI.requestGeneralData("taskApplications",{senderID:[floGlobals.myFloID,floGlobals.myBtcID]}),floCloudAPI.requestGeneralData("userProfile",{senderID:[floGlobals.myFloID,floGlobals.myBtcID]})];await Promise.all(promises);const taskApplications=floDapps.getNextGeneralData("taskApplications","0");for(const application in taskApplications){const{message:{taskID:taskID}}=taskApplications[application];(floGlobals.appObjects.rmInterns.tasks||[]).some((task=>task.id===taskID))&&floGlobals.applications.add(taskID)}const userProfile=floDapps.getNextGeneralData("userProfile","0");floGlobals.userProfile=Object.values(userProfile).at(-1)?.message.encryptedData}["#/landing","#/sign_in","#/sign_up"].includes(window.location.hash)?(history.replaceState(null,null,"#/home"),router.routeTo("home")):router.routeTo(window.location.hash)}catch(err){console.error(err)}})).catch((error=>console.error(error)))}));
|
||||
Loading…
Reference in New Issue
Block a user