mirror of
https://github.com/owncast/owncast.git
synced 2024-11-26 06:46:01 +03:00
Remove duplicate API call + explicitly set loading state
This commit is contained in:
parent
74c812ee12
commit
04b0f4548c
1 changed files with 1 additions and 8 deletions
|
@ -29,23 +29,16 @@ export const FollowerCollection: FC<FollowerCollectionProps> = ({ name, onFollow
|
|||
|
||||
setFollowers(results);
|
||||
setTotal(totalResults);
|
||||
setLoading(false);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getFollowers();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
getFollowers();
|
||||
}, [page]);
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(false);
|
||||
}, [followers]);
|
||||
|
||||
const noFollowers = (
|
||||
<div className={styles.noFollowers} id="followers-collection">
|
||||
<h2>Be the first follower!</h2>
|
||||
|
|
Loading…
Reference in a new issue