mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Remove duplicate API call + explicitly set loading state
This commit is contained in:
parent
74c812ee12
commit
04b0f4548c
@ -29,23 +29,16 @@ export const FollowerCollection: FC<FollowerCollectionProps> = ({ name, onFollow
|
|||||||
|
|
||||||
setFollowers(results);
|
setFollowers(results);
|
||||||
setTotal(totalResults);
|
setTotal(totalResults);
|
||||||
|
setLoading(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
getFollowers();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getFollowers();
|
getFollowers();
|
||||||
}, [page]);
|
}, [page]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setLoading(false);
|
|
||||||
}, [followers]);
|
|
||||||
|
|
||||||
const noFollowers = (
|
const noFollowers = (
|
||||||
<div className={styles.noFollowers} id="followers-collection">
|
<div className={styles.noFollowers} id="followers-collection">
|
||||||
<h2>Be the first follower!</h2>
|
<h2>Be the first follower!</h2>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user