fix: Applied fix for name, the oracle team sharing, sentinel client list visibility
This commit is contained in:
@@ -167,7 +167,8 @@ export function connectPageSocket(
|
||||
pageId: string,
|
||||
handlers: {
|
||||
onMessage: (msg: OracleWSMessage) => void;
|
||||
onReconnect: () => void;
|
||||
onReconnect?: () => void;
|
||||
onOpen?: () => void;
|
||||
onClose: () => void;
|
||||
},
|
||||
): () => void {
|
||||
@@ -184,6 +185,10 @@ export function connectPageSocket(
|
||||
function connect() {
|
||||
ws = new WebSocket(`${wsBase}/ws/oracle/canvas/${pageId}`);
|
||||
|
||||
ws.onopen = () => {
|
||||
handlers.onOpen?.();
|
||||
};
|
||||
|
||||
ws.onmessage = (event) => {
|
||||
try {
|
||||
handlers.onMessage(JSON.parse(event.data as string) as OracleWSMessage);
|
||||
@@ -196,7 +201,7 @@ export function connectPageSocket(
|
||||
handlers.onClose();
|
||||
if (!stopped) {
|
||||
retryTimeout = setTimeout(() => {
|
||||
handlers.onReconnect();
|
||||
handlers.onReconnect?.();
|
||||
connect();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user