if suggested follows is empty, show trending users
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
3af04a79cc
commit
d82c7957be
@ -10,6 +10,7 @@ import useLogin from "@/Hooks/useLogin";
|
|||||||
import { hexToBech32 } from "@/SnortUtils";
|
import { hexToBech32 } from "@/SnortUtils";
|
||||||
import { ErrorOrOffline } from "./ErrorOrOffline";
|
import { ErrorOrOffline } from "./ErrorOrOffline";
|
||||||
import useCachedFetch from "@/Hooks/useCachedFetch";
|
import useCachedFetch from "@/Hooks/useCachedFetch";
|
||||||
|
import TrendingUsers from "@/Element/Trending/TrendingUsers";
|
||||||
|
|
||||||
enum Provider {
|
enum Provider {
|
||||||
NostrBand = 1,
|
NostrBand = 1,
|
||||||
@ -39,7 +40,11 @@ export default function SuggestedProfiles() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const { url, key } = getUrlAndKey();
|
const { url, key } = getUrlAndKey();
|
||||||
const { data: userList, error } = useCachedFetch(url, key, data => {
|
const {
|
||||||
|
data: userList,
|
||||||
|
error,
|
||||||
|
isLoading,
|
||||||
|
} = useCachedFetch(url, key, data => {
|
||||||
switch (provider) {
|
switch (provider) {
|
||||||
case Provider.NostrBand:
|
case Provider.NostrBand:
|
||||||
return data.profiles.map(a => a.pubkey);
|
return data.profiles.map(a => a.pubkey);
|
||||||
@ -51,7 +56,8 @@ export default function SuggestedProfiles() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (error) return <ErrorOrOffline error={error} onRetry={() => {}} />;
|
if (error) return <ErrorOrOffline error={error} onRetry={() => {}} />;
|
||||||
if (!userList) return <PageSpinner />;
|
if (isLoading) return <PageSpinner />;
|
||||||
|
if (userList.length === 0) return <TrendingUsers title={""} />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
Loading…
Reference in New Issue
Block a user