mirror of
https://github.com/urbit/shrub.git
synced 2025-01-03 01:54:43 +03:00
interface: fix tsc
This commit is contained in:
parent
97f334e819
commit
641cf79894
@ -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];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user