interface: fix tsc

This commit is contained in:
Liam Fitzgerald 2021-12-06 14:16:17 -05:00
parent 97f334e819
commit 641cf79894

View File

@ -32,6 +32,10 @@ const useInviteState = createState<InviteState>(
export default useInviteState;
interface InviteWithUid extends Invite {
uid: string;
}
export function useInviteForResource(app: string, ship: string, name: string) {
const { invites } = useInviteState();
const matches = Object.entries(invites?.[app] || {})
@ -39,6 +43,6 @@ export function useInviteForResource(app: string, ship: string, name: string) {
const isMatch = (invite.resource.ship === deSig(ship)
&& invite.resource.name === name)
return isMatch ? [{ uid, ...invite}, ...acc] : acc;
}, [] as Invite[])
}, [] as InviteWithUid[])
return matches?.[0];
}