refactor: no need to sort
This commit is contained in:
@ -28,12 +28,5 @@ export function useZapGoal(host: string, link: NostrLink, leaveOpen = false) {
|
|||||||
sub
|
sub
|
||||||
);
|
);
|
||||||
|
|
||||||
const sorted = useMemo(() => {
|
return data?.at(0);
|
||||||
const s = (data ? [...data] : []).sort(
|
|
||||||
(a: NostrEvent, b: NostrEvent) => b.created_at - a.created_at
|
|
||||||
);
|
|
||||||
return s;
|
|
||||||
}, [data]);
|
|
||||||
|
|
||||||
return sorted.at(0);
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user