diff --git a/main.js b/main.js index dded285..eb38b92 100644 --- a/main.js +++ b/main.js @@ -108,11 +108,14 @@ export class SFrame{ return find; }, resolve: (r,close=true)=>{ - if (close&&[...(stear.elem.children)].indexOf(this.#lastRender._) >= 0) stear.elem.removeChild(this.#lastRender._); + if (close&&this.#lastRender&&[...(stear.elem.children)].indexOf(this.#lastRender._) >= 0) stear.elem.removeChild(this.#lastRender._); res(r); }, call: (elem, args)=>{ return stear.call(elem,args,layer+1); + }, + close: ()=>{ + if (close && this.#lastRender && [...(stear.elem.children)].indexOf(this.#lastRender._) >= 0) stear.elem.removeChild(this.#lastRender._); } }, args); });