Add a per-user lead agent and make the right pane task-focused
This commit is contained in:
+8
-3
@@ -18,6 +18,8 @@ export type Zombie = Schemas["Zombie"];
|
||||
export type ProtocolErrors = Schemas["ProtocolErrors"];
|
||||
export type Snapshot = Schemas["Snapshot"];
|
||||
export type Participant = Schemas["Participant"];
|
||||
export type Focus = Schemas["Focus"];
|
||||
export type TaskTab = Schemas["TaskTab"];
|
||||
|
||||
type Method = "get" | "post" | "put" | "delete";
|
||||
|
||||
@@ -107,7 +109,7 @@ const retryAfterMs = 2_000;
|
||||
|
||||
export function subscribe(
|
||||
after: number,
|
||||
taskId: string | undefined,
|
||||
filter: { task_id?: string; lead?: boolean },
|
||||
onEvent: (ev: ByreEvent) => void,
|
||||
onState: (connected: boolean) => void,
|
||||
): () => void {
|
||||
@@ -121,8 +123,11 @@ export function subscribe(
|
||||
source?.close();
|
||||
heard = Date.now();
|
||||
const query = new URLSearchParams({ after: String(last) });
|
||||
if (taskId) {
|
||||
query.set("task_id", taskId);
|
||||
if (filter.task_id) {
|
||||
query.set("task_id", filter.task_id);
|
||||
}
|
||||
if (filter.lead) {
|
||||
query.set("lead", "true");
|
||||
}
|
||||
const s = new EventSource(`/api/events?${query}`);
|
||||
source = s;
|
||||
|
||||
Reference in New Issue
Block a user