mirror of
https://github.com/muerwre/muerwre.github.io.git
synced 2025-04-25 19:06:41 +07:00
commit 4247aff7889ba00c575befe5f73932d9eedbad0e
Author: Fedor Katurov <gotham48@gmail.com> Date: Thu Nov 3 20:46:37 2022 +0600 fixed buttons placement
This commit is contained in:
parent
468abb8bc0
commit
1f068b4685
184 changed files with 232 additions and 232 deletions
1
nuxt/web-socket.da2a25c3.js
Normal file
1
nuxt/web-socket.da2a25c3.js
Normal file
|
@ -0,0 +1 @@
|
|||
import{M as u,N as i}from"./entry.f8ff8132.js";const n={log:(...t)=>console.log("[Content]",...t),warn:(...t)=>console.warn("[Content]",...t)};let e;function g(){if(!window.WebSocket){n.warn("Could not enable hot reload, your browser does not support WebSocket.");return}const t=o=>{try{if(!JSON.parse(o.data))return;i()}catch{}},s=()=>n.log("WS connected!"),a=o=>{switch(o.code){case"ECONNREFUSED":r(!0);break;default:n.warn("WS Error:",o);break}},l=o=>{o.code===1e3||o.code===1005?n.log("WS closed!"):r(!0)},r=(o=!1)=>{if(o){n.log("WS reconnecting.."),setTimeout(r,1e3);return}if(e){try{e.close()}catch{}e=void 0}const c=`${u().public.content.wsUrl}ws`;n.log(`WS connect to ${c}`),e=new WebSocket(c),e.onopen=s,e.onmessage=t,e.onerror=a,e.onclose=l};return r(),{connect:r}}export{g as useContentWebSocket};
|
Loading…
Add table
Add a link
Reference in a new issue