Skip to content

Commit

Permalink
fix: handle ArrayBufferLike type conversion in PanelPlugin
Browse files Browse the repository at this point in the history
Co-Authored-By: Myles Scolnick <myles@marimo.io>
  • Loading branch information
devin-ai-integration[bot] and mscolnick committed Jan 3, 2025
1 parent 03abfb6 commit c7d8e9f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/plugins/impl/panel/PanelPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,12 @@ const PanelSlot = (props: Props) => {
}

if (buffers && buffers.length > 0) {
receiver.consume(buffers[0].buffer);
// Convert ArrayBufferLike to ArrayBuffer if needed
const bufferData = buffers[0].buffer as ArrayBufferLike;
// Create a new ArrayBuffer from the ArrayBufferLike
const arrayBuffer = new ArrayBuffer(bufferData.byteLength);
new Uint8Array(arrayBuffer).set(new Uint8Array(bufferData));
receiver.consume(arrayBuffer);
} else if (content && typeof content === "string") {
receiver.consume(content);
} else {
Expand Down

0 comments on commit c7d8e9f

Please sign in to comment.