fix: include pre-built dist in repo (no server-side build)
This commit is contained in:
1
neode-ui/dist/assets/mesh-DgF5cqYW.js
vendored
Normal file
1
neode-ui/dist/assets/mesh-DgF5cqYW.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{$ as I,r as l,j as x,B as r}from"./index-DnbYEqLr.js";const O=I("mesh",()=>{const y=l(null),g=l([]),u=l([]),d=l(!1),t=l(null),c=l(!1),i=l({}),m=l(null),p=x(()=>Object.values(i.value).reduce((e,a)=>e+a,0));async function h(){try{d.value=!0,t.value=null;const e=await r.call({method:"mesh.status"});y.value=e}catch(e){t.value=e instanceof Error?e.message:"Failed to fetch mesh status"}finally{d.value=!1}}async function w(){try{const e=await r.call({method:"mesh.peers"});g.value=e.peers}catch(e){t.value=e instanceof Error?e.message:"Failed to fetch mesh peers"}}async function f(e){try{const a=await r.call({method:"mesh.messages",params:e?{limit:e}:{}}),s=a.messages.filter(n=>n.direction==="received"&&!u.value.some(o=>o.id===n.id));for(const n of s)n.peer_contact_id!==m.value&&(i.value[n.peer_contact_id]=(i.value[n.peer_contact_id]||0)+1);u.value=a.messages}catch(a){t.value=a instanceof Error?a.message:"Failed to fetch mesh messages"}}function _(e){m.value=e,delete i.value[e]}function E(){m.value=null}async function F(e,a){try{c.value=!0,t.value=null;const s=await r.call({method:"mesh.send",params:{contact_id:e,message:a.trim()}});return s.sent&&await f(),s}catch(s){throw t.value=s instanceof Error?s.message:"Failed to send mesh message",s}finally{c.value=!1}}async function C(){try{t.value=null,await r.call({method:"mesh.broadcast"})}catch(e){throw t.value=e instanceof Error?e.message:"Failed to broadcast identity",e}}async function S(e){try{t.value=null,await r.call({method:"mesh.configure",params:e}),await h()}catch(a){throw t.value=a instanceof Error?a.message:"Failed to configure mesh",a}}async function b(e,a,s){try{return c.value=!0,t.value=null,await r.call({method:"mesh.send-invoice",params:{contact_id:e,amount_sats:a,memo:s}})}catch(n){throw t.value=n instanceof Error?n.message:"Failed to send invoice",n}finally{c.value=!1}}async function M(e,a,s,n){try{return c.value=!0,t.value=null,await r.call({method:"mesh.send-coordinate",params:{contact_id:e,lat:a,lng:s,label:n}})}catch(o){throw t.value=o instanceof Error?o.message:"Failed to send coordinate",o}finally{c.value=!1}}async function k(e,a,s=!1,n,o){try{return t.value=null,await r.call({method:"mesh.send-alert",params:{message:e,alert_type:a,broadcast:s,lat:n,lng:o}})}catch(v){throw t.value=v instanceof Error?v.message:"Failed to send alert",v}}async function P(e){return r.call({method:"mesh.session-status",params:{contact_id:e}})}async function j(){return r.call({method:"mesh.rotate-prekeys"})}async function A(){await Promise.all([h(),w(),f()])}return{status:y,peers:g,messages:u,loading:d,error:t,sending:c,unreadCounts:i,totalUnread:p,fetchStatus:h,fetchPeers:w,fetchMessages:f,sendMessage:F,broadcastIdentity:C,configure:S,refreshAll:A,markChatRead:_,clearViewingChat:E,sendInvoice:b,sendCoordinate:M,sendAlert:k,getSessionStatus:P,rotatePrekeys:j}});export{O as u};
|
||||
Reference in New Issue
Block a user