feat: fixed build errors
This commit is contained in:
parent
07f9984f03
commit
cfb6ffe107
3 changed files with 9 additions and 3 deletions
|
|
@ -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) => {
|
const getPingQuality = (ping: number | null) => {
|
||||||
if (!ping) return { label: "Unknown", color: "text-muted-foreground" };
|
if (!ping) return { label: "Unknown", color: "text-muted-foreground" };
|
||||||
|
|
|
||||||
|
|
@ -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"
|
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={() => {
|
onClick={() => {
|
||||||
// Call the db to create or get the dm channel
|
// 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) {
|
if (channel) {
|
||||||
router.push(`/channels/me/${channel.id}`)
|
router.push(`/channels/me/${channel.id}`)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,10 @@ export const db = new SipherDB();
|
||||||
/** Get or create a DM channel with another user */
|
/** Get or create a DM channel with another user */
|
||||||
export async function getOrCreateDmChannel(
|
export async function getOrCreateDmChannel(
|
||||||
myUserId: string,
|
myUserId: string,
|
||||||
otherUser: SiPher.ParticipantDetail
|
otherUser: {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
}
|
||||||
): Promise<SiPher.Channel> {
|
): Promise<SiPher.Channel> {
|
||||||
// Generate deterministic channel ID
|
// Generate deterministic channel ID
|
||||||
const channelId = getDmRoomId(myUserId, otherUser.id);
|
const channelId = getDmRoomId(myUserId, otherUser.id);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue