@waveform-playlist/ui-components 5.3.0 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2048,6 +2048,7 @@ var SpectrogramChannel = ({
2048
2048
  }) => {
2049
2049
  const canvasesRef = (0, import_react12.useRef)([]);
2050
2050
  const registeredIdsRef = (0, import_react12.useRef)([]);
2051
+ const transferredCanvasesRef = (0, import_react12.useRef)(/* @__PURE__ */ new WeakSet());
2051
2052
  const isWorkerMode = !!(workerApi && clipId);
2052
2053
  const canvasRef = (0, import_react12.useCallback)(
2053
2054
  (canvas) => {
@@ -2068,10 +2069,12 @@ var SpectrogramChannel = ({
2068
2069
  for (let i = 0; i < canvases2.length; i++) {
2069
2070
  const canvas = canvases2[i];
2070
2071
  if (!canvas) continue;
2072
+ if (transferredCanvasesRef.current.has(canvas)) continue;
2071
2073
  const canvasId = `${clipId}-ch${index}-chunk${i}`;
2072
2074
  try {
2073
2075
  const offscreen = canvas.transferControlToOffscreen();
2074
2076
  workerApi.registerCanvas(canvasId, offscreen);
2077
+ transferredCanvasesRef.current.add(canvas);
2075
2078
  ids.push(canvasId);
2076
2079
  widths.push(Math.min(length - i * MAX_CANVAS_WIDTH2, MAX_CANVAS_WIDTH2));
2077
2080
  } catch (err) {