From 593d38c29eddbdf04e17b104d249291e55db714a Mon Sep 17 00:00:00 2001 From: YeonV Date: Mon, 27 Jan 2025 04:25:42 +0100 Subject: [PATCH] remove feature: websocket timestamp debug --- src/components/PixelGraph/PixelGraphBase.tsx | 14 ---------- .../PixelGraph/PixelGraphCanvas.tsx | 28 ++----------------- src/pages/Settings/BetaFeatures.tsx | 7 ----- src/store/ui/storeFeatures.tsx | 3 -- 4 files changed, 2 insertions(+), 50 deletions(-) diff --git a/src/components/PixelGraph/PixelGraphBase.tsx b/src/components/PixelGraph/PixelGraphBase.tsx index 13bbfbe8..9564c7e7 100644 --- a/src/components/PixelGraph/PixelGraphBase.tsx +++ b/src/components/PixelGraph/PixelGraphBase.tsx @@ -2,7 +2,6 @@ import { useEffect, useState } from 'react' import useStore from '../../store/useStore' import { useShallow } from 'zustand/shallow' import hexColor from '../../pages/Devices/EditVirtuals/EditMatrix/Actions/hexColor' -import ws from '../../utils/Websocket' const PixelGraphBase = ({ virtId, @@ -34,7 +33,6 @@ const PixelGraphBase = ({ const showWarning = useStore((state) => state.uiPersist.warnings.lessPixels) const round = useStore((state) => state.uiPersist.pixelGraphSettings?.round) const space = useStore((state) => state.uiPersist.pixelGraphSettings?.space) - const features = useStore((state) => state.features) const stretch = useStore( (state) => state.uiPersist.pixelGraphSettings?.stretch ) @@ -67,18 +65,6 @@ const PixelGraphBase = ({ setPixels(e.detail.pixels) if (e.detail.shape[0] !== shape[0] && e.detail.shape[1] !== shape[1]) setShape(e.detail.shape) - if (features.websocket_debug) { - if (ws && typeof ws !== 'string' && e.detail.timestamp) { - const request = { - type: 'event', - event_type: 'visualisation_updated', - id: e.detail.rid, - vis_id: virtId, - timestamp: e.detail.timestamp - } - ws.send(JSON.stringify(request)) - } - } } } document.addEventListener('visualisation_update', handleWebsockets) diff --git a/src/components/PixelGraph/PixelGraphCanvas.tsx b/src/components/PixelGraph/PixelGraphCanvas.tsx index e5cf19bf..ddaacc82 100644 --- a/src/components/PixelGraph/PixelGraphCanvas.tsx +++ b/src/components/PixelGraph/PixelGraphCanvas.tsx @@ -2,7 +2,6 @@ import { useEffect, useRef } from 'react' import useStore from '../../store/useStore' import { useShallow } from 'zustand/shallow' import hexColor from '../../pages/Devices/EditVirtuals/EditMatrix/Actions/hexColor' -import ws from '../../utils/Websocket' const PixelGraphCanvas = ({ virtId, @@ -35,7 +34,6 @@ const PixelGraphCanvas = ({ config: state.config })) ) - const features = useStore((state) => state.features) const smoothing = useStore( (state) => state.uiPersist.pixelGraphSettings?.smoothing ) @@ -88,19 +86,6 @@ const PixelGraphCanvas = ({ imageData.data[index + 3] = 255 // Alpha channel } ctx.putImageData(imageData, 0, 0) - - if (features.websocket_debug) { - if (ws && typeof ws !== 'string' && e.detail.timestamp) { - const request = { - type: 'event', - event_type: 'visualisation_updated', - id: e.detail.rid, - vis_id: virtId, - timestamp: e.detail.timestamp - } - ws.send(JSON.stringify(request)) - } - } } } @@ -108,16 +93,7 @@ const PixelGraphCanvas = ({ return () => { document.removeEventListener('visualisation_update', handleWebsockets) } - }, [ - virtId, - virtuals, - pixelGraphs, - devices, - graphs, - config, - showMatrix, - features.websocket_debug - ]) + }, [virtId, virtuals, pixelGraphs, devices, graphs, config, showMatrix]) const render = (virtuals[virtId].active && virtuals[virtId].effect?.name) || @@ -136,7 +112,7 @@ const PixelGraphCanvas = ({ className={`${className} ${active ? 'active' : ''}`} style={{ maxWidth: fullScreen ? '100vw' : '520px', - maxHeight: fullScreen ? '100vh' : 'unset', + maxHeight: fullScreen ? '100vh' : '380px', height: !render || virtuals[virtId]?.config?.rows < 2 || !showMatrix ? '20px' diff --git a/src/pages/Settings/BetaFeatures.tsx b/src/pages/Settings/BetaFeatures.tsx index 8999a1cb..0e290d3d 100644 --- a/src/pages/Settings/BetaFeatures.tsx +++ b/src/pages/Settings/BetaFeatures.tsx @@ -23,13 +23,6 @@ const BetaFeatures = () => { checked={features.wakelock} onChange={() => setFeatures('wakelock', !features.wakelock)} /> - - setFeatures('websocket_debug', !features.websocket_debug) - } - /> {showFeatures.integrations ? ( ({ matrix_cam: false, wakelock: false, melbankGraph: false, - websocket_debug: false, sceneMostUsed: false, scenePlaylist: false, sceneRecent: false, @@ -104,7 +102,6 @@ const storeFeatures = (set: any) => ({ matrix_cam: false, wakelock: false, melbankGraph: false, - websocket_debug: false, sceneMostUsed: false, scenePlaylist: false, sceneRecent: false,