Add missing types to party

This commit is contained in:
Mitchell McCaffrey 2021-07-18 09:12:09 +10:00
parent a6a233542e
commit 830798dc74
2 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,7 @@ type PartyProviderProps = {
};
export function PartyProvider({ session, children }: PartyProviderProps) {
const [partyState, setPartyState] = useState({});
const [partyState, setPartyState] = useState<PartyState>({});
useEffect(() => {
function handleSocketPartyState(partyState: PartyState) {

View File

@ -22,7 +22,9 @@ type NetworkedPartyProps = { gameId: string; session: Session };
function NetworkedParty({ gameId, session }: NetworkedPartyProps) {
const partyState = useParty();
const [stream, setStream] = useState<MediaStream | null>(null);
const [partyStreams, setPartyStreams] = useState({});
const [partyStreams, setPartyStreams] = useState<Record<string, MediaStream>>(
{}
);
const { addToast } = useToasts();