From 7cee79f103fcea11ca2a567cb0c304fd94cc40c7 Mon Sep 17 00:00:00 2001 From: HF Date: Thu, 16 Mar 2023 16:21:01 +0100 Subject: [PATCH] fix "a.getRenderer is not a function" error in popups, use optional chaining synthax --- src/socket/SocketClient.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/socket/SocketClient.js b/src/socket/SocketClient.js index 42659d6..f836835 100644 --- a/src/socket/SocketClient.js +++ b/src/socket/SocketClient.js @@ -146,8 +146,8 @@ class SocketClient { this.store.getState().canvas.canvasId, )); // register chunks - const chunkids = this.getRenderer().recChunkIds; - if (chunkids.length) { + const chunkids = this.getRenderer?.().recChunkIds; + if (chunkids?.length) { console.log(`Register ${chunkids.length} chunks`); this.send(dehydrateRegMChunks(chunkids)); }