Fix empty array not falsy bug

This commit is contained in:
Jorik Schellekens 2020-09-13 18:02:18 +01:00
parent 5f5eb60c02
commit 471c9cd21d
2 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ const LinkPreview: React.FC<IProps> = ({ link }: IProps) => {
const hses = useHSs(link);
if (!hses) {
if (!hses.length) {
content = (
<>
<DefaultPreview link={link} />

View File

@ -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)