mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: fix messages worker
This commit is contained in:
1 file changed
+4
@@ -40,6 +40,10 @@ function initConn(path: string, port: MessagePort, cookie: any) {
|
||||
conn.onclose = (ev) => broadcastMsg({ type: 'close', error: ev.reason });
|
||||
conn.onmessage = (message) => {
|
||||
if (process.env.NODE_ENV !== 'production') console.log('SharedWorker.port.onmessage: ', message);
|
||||
if (message.data === 'ping') {
|
||||
conn.send('pong');
|
||||
return;
|
||||
}
|
||||
const payload = JSON.parse(message.data);
|
||||
if (payload.event === 'auth') {
|
||||
if (['PermissionError', 'PrivilegeError'].includes(payload.error)) {
|
||||
|
||||
Reference in new issue
Block a user