remove unnecessary fetches of api (#960)

* skip repeating fetch of user on session changes
* fix some issues on integrations
This commit is contained in:
Alex Johansson
2021-10-15 00:00:50 +02:00
committed by GitHub
parent c2c37b701e
commit 59e25ad04e
2 changed files with 11 additions and 16 deletions

View File

@@ -37,15 +37,8 @@ import { useViewerI18n } from "./I18nLanguageHandler";
import Logo from "./Logo";
function useMeQuery() {
const [session] = useSession();
const meQuery = trpc.useQuery(["viewer.me"]);
useEffect(() => {
// refetch if sesion changes
meQuery.refetch();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [session]);
return meQuery;
}