diff --git a/src/components/home/csi.tsx b/src/components/home/csi.tsx index d6cb685..1e7782e 100644 --- a/src/components/home/csi.tsx +++ b/src/components/home/csi.tsx @@ -65,7 +65,7 @@ export default function ConnectionStatusIndicator({ socketStatus, socketInfo, di } }; - const config = statusConfig[socketStatus] || statusConfig.error; + const config = statusConfig[socketStatus as keyof typeof statusConfig] || statusConfig.error; const getPingQuality = (ping: number | null) => { if (!ping) return { label: "Unknown", color: "text-muted-foreground" }; diff --git a/src/components/ui/friends/friend-list-item.tsx b/src/components/ui/friends/friend-list-item.tsx index a61a927..1474c29 100644 --- a/src/components/ui/friends/friend-list-item.tsx +++ b/src/components/ui/friends/friend-list-item.tsx @@ -51,7 +51,10 @@ export function FriendListItem({ className="flex flex-row items-center justify-between w-full p-3 rounded-md hover:bg-accent/50 transition-colors group border border-transparent hover:border-border/40 hover:cursor-pointer" onClick={() => { // Call the db to create or get the dm channel - getOrCreateDmChannel(userId, friend).then((channel) => { + getOrCreateDmChannel(userId, { + id: friend._id, + name: displayName ?? "", + }).then((channel) => { if (channel) { router.push(`/channels/me/${channel.id}`) } diff --git a/src/lib/db/index.ts b/src/lib/db/index.ts index ee8e9a8..888babc 100644 --- a/src/lib/db/index.ts +++ b/src/lib/db/index.ts @@ -61,7 +61,10 @@ export const db = new SipherDB(); /** Get or create a DM channel with another user */ export async function getOrCreateDmChannel( myUserId: string, - otherUser: SiPher.ParticipantDetail + otherUser: { + id: string + name: string + } ): Promise { // Generate deterministic channel ID const channelId = getDmRoomId(myUserId, otherUser.id);