The page was being rendered during the async router.replace call (#306)
* The page was being rendered during the async router.replace call * Adding a different, slightly smaller fix
This commit is contained in:
parent
ebb3e87284
commit
5334c350e2
1 changed files with 2 additions and 4 deletions
|
@ -32,11 +32,9 @@ export default function Shell(props) {
|
||||||
|
|
||||||
if (!loading && !session) {
|
if (!loading && !session) {
|
||||||
router.replace("/auth/login");
|
router.replace("/auth/login");
|
||||||
} else if (loading) {
|
|
||||||
return <p className="text-gray-400">Loading...</p>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return session ? (
|
||||||
<div>
|
<div>
|
||||||
<div className="bg-gradient-to-b from-blue-600 via-blue-600 to-blue-300 pb-32">
|
<div className="bg-gradient-to-b from-blue-600 via-blue-600 to-blue-300 pb-32">
|
||||||
<nav className="bg-blue-600">
|
<nav className="bg-blue-600">
|
||||||
|
@ -271,5 +269,5 @@ export default function Shell(props) {
|
||||||
<div className="max-w-7xl mx-auto pb-12 px-4 sm:px-6 lg:px-8">{props.children}</div>
|
<div className="max-w-7xl mx-auto pb-12 px-4 sm:px-6 lg:px-8">{props.children}</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
);
|
) : null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue