Skip to content

Commit 16cca29

Browse files
Ci fixes
1 parent 2885eab commit 16cca29

1 file changed

Lines changed: 43 additions & 19 deletions

File tree

‎src/pages/chambers/Chamber.tsx‎

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ const Chamber: React.FC = () => {
7878
const [peerId] = useState(
7979
() => `peer_${Math.random().toString(16).slice(2, 10)}`,
8080
);
81-
const peerConnectionsRef = useRef<Map<string, RTCPeerConnection>>(
82-
new Map(),
83-
);
81+
const peerConnectionsRef = useRef<Map<string, RTCPeerConnection>>(new Map());
8482
const dataChannelsRef = useRef<Map<string, RTCDataChannel>>(new Map());
8583
const chatMessageIdsRef = useRef<Set<string>>(new Set());
8684

@@ -108,9 +106,7 @@ const Chamber: React.FC = () => {
108106
setThreadMessages([]);
109107
const found = listRes.items.find((c) => c.id === id);
110108
const fallbackTitle = chamberRes.chamber?.title;
111-
setChamberTitle(
112-
found?.name ?? fallbackTitle ?? id.replace(/-/g, " "),
113-
);
109+
setChamberTitle(found?.name ?? fallbackTitle ?? id.replace(/-/g, " "));
114110
setLoadError(null);
115111
} catch (error) {
116112
if (!active) return;
@@ -194,10 +190,16 @@ const Chamber: React.FC = () => {
194190
{ label: "Origin", value: chamber.createdByProposalId ?? "Genesis" },
195191
];
196192
if (chamber.dissolvedAt) {
197-
items.push({ label: "Dissolved", value: chamber.dissolvedAt.slice(0, 10) });
193+
items.push({
194+
label: "Dissolved",
195+
value: chamber.dissolvedAt.slice(0, 10),
196+
});
198197
}
199198
if (chamber.dissolvedByProposalId) {
200-
items.push({ label: "Dissolved by", value: chamber.dissolvedByProposalId });
199+
items.push({
200+
label: "Dissolved by",
201+
value: chamber.dissolvedByProposalId,
202+
});
201203
}
202204
return items;
203205
}, [data]);
@@ -272,7 +274,7 @@ const Chamber: React.FC = () => {
272274
void sendSignal({
273275
kind: "candidate",
274276
targetPeerId: remotePeerId,
275-
payload: event.candidate.toJSON(),
277+
payload: event.candidate.toJSON() as Record<string, unknown>,
276278
});
277279
};
278280
pc.onconnectionstatechange = () => {
@@ -320,7 +322,10 @@ const Chamber: React.FC = () => {
320322
await sendSignal({
321323
kind: "answer",
322324
targetPeerId: remotePeerId,
323-
payload: pc.localDescription.toJSON(),
325+
payload: pc.localDescription.toJSON() as unknown as Record<
326+
string,
327+
unknown
328+
>,
324329
});
325330
}
326331
return;
@@ -400,7 +405,10 @@ const Chamber: React.FC = () => {
400405
await sendSignal({
401406
kind: "offer",
402407
targetPeerId: peer.peerId,
403-
payload: pc.localDescription.toJSON(),
408+
payload: pc.localDescription.toJSON() as unknown as Record<
409+
string,
410+
unknown
411+
>,
404412
});
405413
}
406414
}
@@ -435,7 +443,9 @@ const Chamber: React.FC = () => {
435443
event.preventDefault();
436444
if (!id) return;
437445
if (!canWrite) {
438-
setThreadError("You are not eligible to start a thread in this chamber.");
446+
setThreadError(
447+
"You are not eligible to start a thread in this chamber.",
448+
);
439449
return;
440450
}
441451
if (!threadTitle.trim() || !threadBody.trim()) {
@@ -703,9 +713,13 @@ const Chamber: React.FC = () => {
703713
});
704714
}
705715
const columns =
706-
metaTiles.length === 3 ? "sm:grid-cols-3" : "sm:grid-cols-2";
716+
metaTiles.length === 3
717+
? "sm:grid-cols-3"
718+
: "sm:grid-cols-2";
707719
return (
708-
<div className={`mt-3 grid gap-2 text-sm text-muted ${columns}`}>
720+
<div
721+
className={`mt-3 grid gap-2 text-sm text-muted ${columns}`}
722+
>
709723
{metaTiles.map((tile) => (
710724
<Surface
711725
key={tile.label}
@@ -822,13 +836,17 @@ const Chamber: React.FC = () => {
822836
onChange={(event) => setThreadBody(event.target.value)}
823837
placeholder="Write the opening post"
824838
disabled={!canWrite || threadBusy}
825-
className="min-h-[110px] w-full resize-y rounded-xl border border-border bg-panel-alt px-3 py-2 text-sm text-text shadow-[var(--shadow-control)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--primary-dim)]"
839+
className="min-h-[110px] w-full resize-y rounded-xl border border-border bg-panel-alt px-3 py-2 text-sm text-text shadow-[var(--shadow-control)] focus-visible:ring-2 focus-visible:ring-[color:var(--primary-dim)] focus-visible:outline-none"
826840
/>
827841
{threadError ? (
828842
<p className="text-sm text-destructive">{threadError}</p>
829843
) : null}
830844
<div className="flex flex-wrap items-center gap-2">
831-
<Button type="submit" size="sm" disabled={!canWrite || threadBusy}>
845+
<Button
846+
type="submit"
847+
size="sm"
848+
disabled={!canWrite || threadBusy}
849+
>
832850
{threadBusy ? "Posting..." : "Post thread"}
833851
</Button>
834852
{!canWrite ? (
@@ -896,7 +914,11 @@ const Chamber: React.FC = () => {
896914
<p className="text-muted">No replies yet.</p>
897915
) : (
898916
threadMessages.map((message) => (
899-
<Surface key={message.id} variant="panel" className="px-3 py-2">
917+
<Surface
918+
key={message.id}
919+
variant="panel"
920+
className="px-3 py-2"
921+
>
900922
<p className="text-xs text-muted">
901923
{message.author} · {message.createdAt.slice(0, 10)}
902924
</p>
@@ -911,10 +933,12 @@ const Chamber: React.FC = () => {
911933
onChange={(event) => setThreadReplyBody(event.target.value)}
912934
placeholder="Write a reply"
913935
disabled={!canWrite || threadReplyBusy}
914-
className="min-h-[90px] w-full resize-y rounded-xl border border-border bg-panel-alt px-3 py-2 text-sm text-text shadow-[var(--shadow-control)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--primary-dim)]"
936+
className="min-h-[90px] w-full resize-y rounded-xl border border-border bg-panel-alt px-3 py-2 text-sm text-text shadow-[var(--shadow-control)] focus-visible:ring-2 focus-visible:ring-[color:var(--primary-dim)] focus-visible:outline-none"
915937
/>
916938
{threadReplyError ? (
917-
<p className="text-sm text-destructive">{threadReplyError}</p>
939+
<p className="text-sm text-destructive">
940+
{threadReplyError}
941+
</p>
918942
) : null}
919943
<div className="flex flex-wrap items-center gap-2">
920944
<Button

0 commit comments

Comments
 (0)