mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-07-16 17:00:02 -05:00
fix apollo warning
This commit is contained in:
parent
53a8964f84
commit
199eae33d9
|
|
@ -28,7 +28,17 @@ function createApolloClient(context?: Context) {
|
|||
return new ApolloClient({
|
||||
ssrMode: typeof window === "undefined",
|
||||
link: createIsomorphLink(context),
|
||||
cache: new InMemoryCache(),
|
||||
cache: new InMemoryCache({
|
||||
typePolicies: {
|
||||
User: {
|
||||
fields: {
|
||||
profile: {
|
||||
merge: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,8 +46,9 @@ const ProfilePage = ({ identifier }: { identifier: string }) => {
|
|||
|
||||
// FIXME: handle fallback
|
||||
const getUserByIdentifier = data?.getUserByIdentifier;
|
||||
if (!getUserByIdentifier && typeof window !== "undefined")
|
||||
if (!getUserByIdentifier && typeof window !== "undefined") {
|
||||
router.push("/404");
|
||||
}
|
||||
|
||||
return getUserByIdentifier ? <Profile user={getUserByIdentifier} /> : null;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user