Rename pairing model
This commit is contained in:
parent
a384342fb1
commit
eb27ec9df9
@ -28,7 +28,7 @@ import {
|
|||||||
Zap,
|
Zap,
|
||||||
} from "lucide-react"
|
} from "lucide-react"
|
||||||
import { useSearchParams } from "next/navigation"
|
import { useSearchParams } from "next/navigation"
|
||||||
import { PairingProcess } from "@/lib/4nk/models/PairingProcess"
|
import { PairingData } from "@/lib/4nk/models/PairingData"
|
||||||
|
|
||||||
interface ChatProps {
|
interface ChatProps {
|
||||||
heightClass?: string
|
heightClass?: string
|
||||||
@ -39,7 +39,7 @@ interface ChatProps {
|
|||||||
export default function Chat({ heightClass = "h-[calc(100vh-8rem)]", processes, myProcesses }: ChatProps) {
|
export default function Chat({ heightClass = "h-[calc(100vh-8rem)]", processes, myProcesses }: ChatProps) {
|
||||||
const [selectedConversation, setSelectedConversation] = useState("")
|
const [selectedConversation, setSelectedConversation] = useState("")
|
||||||
const [newMessage, setNewMessage] = useState("")
|
const [newMessage, setNewMessage] = useState("")
|
||||||
const [pairingProcesses, setPairingProcesses] = useState<PairingProcess[]>([])
|
const [pairingProcesses, setPairingProcesses] = useState<PairingData[]>([])
|
||||||
const [isLoading, setIsLoading] = useState(true)
|
const [isLoading, setIsLoading] = useState(true)
|
||||||
const [searchQuery, setSearchQuery] = useState("")
|
const [searchQuery, setSearchQuery] = useState("")
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ export default function Chat({ heightClass = "h-[calc(100vh-8rem)]", processes,
|
|||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
|
|
||||||
// Filter pairing processes (those with memberPublicName in publicData)
|
// Filter pairing processes (those with memberPublicName in publicData)
|
||||||
const pairingList: PairingProcess[] = []
|
const pairingList: PairingData[] = []
|
||||||
Object.entries(processes).forEach(([processId, process]) => {
|
Object.entries(processes).forEach(([processId, process]) => {
|
||||||
// Get the latest state
|
// Get the latest state
|
||||||
const latestState = process.states?.[process.states.length - 2] // -2 because last state is usually empty
|
const latestState = process.states?.[process.states.length - 2] // -2 because last state is usually empty
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
export interface PairingProcess {
|
export interface PairingData {
|
||||||
id: string;
|
id: string;
|
||||||
memberPublicName: string;
|
memberPublicName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isPairingProcess(data: any): data is PairingProcess {
|
export function isPairingData(data: any): data is PairingData {
|
||||||
if (typeof data !== 'object' || data === null) return false;
|
if (typeof data !== 'object' || data === null) return false;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
Loading…
x
Reference in New Issue
Block a user