Skip to content

Commit ae378c5

Browse files
committed
convert to propert Uint8Array
1 parent c45928c commit ae378c5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sim/create.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Webxdc, ReceivedStatusUpdate, RealtimeListener as WebxdcRealtimeListener } from "@webxdc/types";
1+
import { Webxdc, ReceivedStatusUpdate } from "@webxdc/types";
22
import { RealtimeListener as RTL } from "../backend/message"
33
type UpdatesMessage = {
44
type: "updates";
@@ -72,8 +72,9 @@ export function createWebXdc(
7272
} else if (isRealtimeMessage(message)) {
7373
// TODO: move this out of setUpdateListener because otherwise
7474
// You have to set an update listener such that realtime works
75-
console.log("received realtime data at frontend")
76-
realtime!.receive(message.data)
75+
// Conversion to any because the actual data is a dict representation of Uint8Array
76+
// This is due to JSON.stringify conversion.
77+
realtime!.receive(new Uint8Array(Object.values(message.data as any)))
7778
} else if (isClearMessage(message)) {
7879
log("clear");
7980
transport.clear();

0 commit comments

Comments
 (0)