Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Revert "Manage WebSocket reference in screenshot editor context"

Richie McIlroy5b5b7330c4cb
diff --git a/apps/desktop/src/routes/screenshot-editor/context.tsx b/apps/desktop/src/routes/screenshot-editor/context.tsx
index 43d9b449d..da837aad5 100644
--- a/apps/desktop/src/routes/screenshot-editor/context.tsx
+++ b/apps/desktop/src/routes/screenshot-editor/context.tsx
@@ -134,7 +134,6 @@ function createScreenshotEditorContext() {
});
const [latestFrame, setLatestFrame] = createLazySignal<FrameData>();
- const [wsRef, setWsRef] = createSignal<WebSocket | null>(null);
const [editorInstance] = createResource(async () => {
const instance = await commands.createScreenshotEditorInstance();
@@ -177,7 +176,6 @@ function createScreenshotEditorContext() {
const ws = new WebSocket(instance.framesSocketUrl);
ws.binaryType = "arraybuffer";
- setWsRef(ws);
ws.onmessage = async (event) => {
const buffer = event.data as ArrayBuffer;
if (buffer.byteLength < 24) return;
@@ -241,10 +239,6 @@ function createScreenshotEditorContext() {
if (frame?.bitmap) {
frame.bitmap.close();
}
- const ws = wsRef();
- if (ws) {
- ws.close();
- }
});
const saveConfig = debounce((config: ProjectConfiguration) => {