Skip to content

Commit f08f1d7

Browse files
committed
adjust to naming convention
Why are there different types for the seeminly same purpose on front and backend?
1 parent 1c7c9f4 commit f08f1d7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

backend/instance.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class Instances {
136136
instance.webXdc.connectRealtime((data) => {
137137
return broadcast(
138138
wss,
139-
JSON.stringify({ type: "sendRealtime", data }),
139+
JSON.stringify({ type: "realtime", data }),
140140
);
141141
});
142142
} else if (isSetUpdateListenerMessage(parsed)) {

backend/message.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class Processor implements IProcessor {
193193

194194
distributeRealtime(instanceId: string, data: Uint8Array) {
195195
this.onMessage({
196-
type: "sendRealtime",
196+
type: "realtime-sent",
197197
instanceId: instanceId,
198198
instanceColor: getColorForId(instanceId),
199199
data,

sim/create.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export function createWebXdc(
260260
);
261261
transport.onConnect(() => {
262262
realtime!.sendHook = (data) => {
263-
transport.send({ type: "realtime", data } as RealtimeMessage);
263+
transport.send({ type: "sendRealtime", data });
264264
log("send realtime", { data });
265265
};
266266
});

types/message.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export type UpdateMessage =
1616

1717
export type Message =
1818
| UpdateMessage
19-
| ({ type: "sendRealtime"; data: Uint8Array } & InstanceMessage)
2019
| ({ type: "clear" } & InstanceMessage)
2120
| ({ type: "connect" } & InstanceMessage)
2221
| ({ type: "connect-realtime" } & InstanceMessage)
22+
| ({ type: "realtime-sent"; data: Uint8Array } & InstanceMessage)
2323
| ({ type: "realtime-received"; data: Uint8Array } & InstanceMessage);

0 commit comments

Comments
 (0)