From 8185b59771099c9e238f8f65fae1d6644ffbb07d Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Wed, 8 Sep 2021 19:35:53 +0200 Subject: [PATCH] fix: redirect to / on empty invites --- src/pages/RevoltApp.tsx | 2 +- src/pages/invite/Invite.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/RevoltApp.tsx b/src/pages/RevoltApp.tsx index 7d861746..8d8af49b 100644 --- a/src/pages/RevoltApp.tsx +++ b/src/pages/RevoltApp.tsx @@ -121,7 +121,7 @@ export default function App() { - + diff --git a/src/pages/invite/Invite.tsx b/src/pages/invite/Invite.tsx index 640fe849..be29427b 100644 --- a/src/pages/invite/Invite.tsx +++ b/src/pages/invite/Invite.tsx @@ -1,6 +1,6 @@ import { ArrowBack } from "@styled-icons/boxicons-regular"; import { autorun } from "mobx"; -import { useHistory, useParams } from "react-router-dom"; +import { Redirect, useHistory, useParams } from "react-router-dom"; import { RetrievedInvite } from "revolt-api/types/Invites"; import styles from "./Invite.module.scss"; @@ -49,6 +49,8 @@ export default function Invite() { } }, [client, code, invite, status]); + if (code === undefined) return ; + if (typeof invite === "undefined") { return (