dolthub / dolthub-issues

Issues for dolthub.com
https://dolthub.com
4 stars 1 forks source link

refresh the database list after accepting a collaboration invitation #536

Open liuliu-dev opened 5 months ago

liuliu-dev commented 5 months ago

currently after the invitation is accepted, the user database list won't change until refreshing the page.

we have this useEffect in hooks like useUserRepoList, useOwnerRepoList, and when repoList.list.length !== 0 it won't reset the repoList even data has changed

  useEffect(() => {
    if (data && repoList.list.length === 0) {
      setRepoList(data.userRepos);
      setLoad(false);
    }
  }, [data, repoList.list.length]);