Fix empty array not falsy bug
This commit is contained in:
parent
5f5eb60c02
commit
471c9cd21d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user