mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-10 08:06:41 +00:00
2 lines
720 B
JavaScript
2 lines
720 B
JavaScript
import{L as o,P as b,b as l,c as r}from"./index.56f88796.js";import{w as t}from"./index.af5cccf7.js";try{o()}catch{o({level:b?l.Debug:l.Info,errorTrace:!1})}const g=t(!1),h=t(!1),I=t(!1),{onAuthChange:u}=r();u(s=>{var a;const{dbg:e}=o();e("onAuthChange in store",{...s}),g.set(s.isValid),h.set(!!((a=s.model)!=null&&a.verified)),I.set(!0)});const n=t({}),d=t(!1);g.subscribe(async s=>{let e;if(!s){n.set({}),d.set(!1),e==null||e().then(()=>{e=void 0}).catch(console.error);return}const{getAllInstancesById:a}=r(),f=await a();n.set(f),d.set(!0),r().client.collection("instances").subscribe("*",c=>{n.update(i=>(i[c.record.id]=c.record,i))}).then(c=>e=c).catch(console.error)});export{n as a,h as b,I as c,d as g,g as i};
|