Skip to content
Snippets Groups Projects
Commit 471c9cd2 authored by Jorik Schellekens's avatar Jorik Schellekens
Browse files

Fix empty array not falsy bug

parent 5f5eb60c
Branches
Tags
No related merge requests found
......@@ -120,7 +120,7 @@ const LinkPreview: React.FC<IProps> = ({ link }: IProps) => {
const hses = useHSs(link);
if (!hses) {
if (!hses.length) {
content = (
<>
<DefaultPreview link={link} />
......
......@@ -77,7 +77,7 @@ export const WrappedInviterPreview: React.FC<WrappedInviterProps> = ({
const [user, setUser] = useState<User | undefined>(undefined);
const hss = useHSs(link);
useEffect(() => {
if (hss) {
if (hss.length) {
client(hss[0])
.then((c) => getUserDetails(c, link.identifier))
.then(setUser)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment