UNPKG

@sofaws/dapp-core

Version:

A library to hold the main logic for a dapp on the Elrond Network

3 lines (2 loc) 853 B
import{a as w}from"./chunk-SIAIYQNL.js";import{h as p}from"./chunk-GK2OH76G.js";import{a as i,b as r,c as E}from"./chunk-2W2L47UL.js";import{a,b as A}from"./chunk-RYMWXK25.js";import{a as c,f as y}from"./chunk-J6375EXR.js";import{m as d,s as L}from"./chunk-ZR7YL3KO.js";import{j as g,m}from"./chunk-HBP5N4FR.js";m();L();w();E();A();y();import x from"lodash.throttle";var I=[d],h=x(()=>{r(i())},5e3),K=n=>e=>o=>{var l;if(I.includes(o.type))return e(o);let t=n.getState(),s=a.local.getItem(c.loginExpiresAt);if(!((l=t==null?void 0:t.loginInfo)==null?void 0:l.isLoggedIn))return e(o);if(s==null)return r(i());let f=Date.now();return s-f<0?setTimeout(()=>g(void 0,null,function*(){console.log("session expired");try{n.dispatch(p())}catch(u){console.error("error logging out",u)}}),1e3):(h(),e(o))};export{K as a}; //# sourceMappingURL=chunk-TC7CAYWH.js.map