mirror of
https://github.com/urbit/shrub.git
synced 2025-01-06 21:18:42 +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;
|
export default useInviteState;
|
||||||
|
|
||||||
|
interface InviteWithUid extends Invite {
|
||||||
|
uid: string;
|
||||||
|
}
|
||||||
|
|
||||||
export function useInviteForResource(app: string, ship: string, name: string) {
|
export function useInviteForResource(app: string, ship: string, name: string) {
|
||||||
const { invites } = useInviteState();
|
const { invites } = useInviteState();
|
||||||
const matches = Object.entries(invites?.[app] || {})
|
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)
|
const isMatch = (invite.resource.ship === deSig(ship)
|
||||||
&& invite.resource.name === name)
|
&& invite.resource.name === name)
|
||||||
return isMatch ? [{ uid, ...invite}, ...acc] : acc;
|
return isMatch ? [{ uid, ...invite}, ...acc] : acc;
|
||||||
}, [] as Invite[])
|
}, [] as InviteWithUid[])
|
||||||
return matches?.[0];
|
return matches?.[0];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user