fix
This commit is contained in:
parent
c35452a085
commit
8f2b07872c
|
|
@ -85,7 +85,7 @@ export const SyncActions = {
|
|||
type: "join";
|
||||
id: string;
|
||||
}
|
||||
| { type: "code"; id: string; action: "open" | "close" }
|
||||
| { type: "code"; id: string; name: string; action: "open" | "close" }
|
||||
) => {},
|
||||
client: {
|
||||
info: async (client_ids: string[]) =>
|
||||
|
|
|
|||
|
|
@ -4,9 +4,18 @@ import { activity as a } from "../entity/activity";
|
|||
export const activity: SAction["activity"] = async function (
|
||||
this: SyncConnection,
|
||||
name,
|
||||
type,
|
||||
id
|
||||
act
|
||||
) {
|
||||
if (type === "join") a.site.room(id).join({ ws: this.ws });
|
||||
if (type === "leave") a.site.room(id).leave({ ws: this.ws });
|
||||
const me = { ws: this.ws };
|
||||
if (act.type === "join") a.site.room(act.id).join(me);
|
||||
if (act.type === "code") {
|
||||
a.site.room(act.id).set(me, (ws, data) => {
|
||||
if (act.action === "open") {
|
||||
data.code = { name: act.name };
|
||||
} else {
|
||||
delete data.code;
|
||||
}
|
||||
return data;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ export const EdPopCode = () => {
|
|||
action: p.ui.popup.code.open ? "open" : "close",
|
||||
id: p.site.id,
|
||||
type: "code",
|
||||
name: "main",
|
||||
});
|
||||
}, [p.ui.popup.code.open]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue