forked from abner/for-legacy-web
Start migration to revolt.js@5.0.0.
200 error milestone
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
import { ArrowBack } from "@styled-icons/boxicons-regular";
|
||||
import { autorun } from "mobx";
|
||||
import { useStore } from "react-redux";
|
||||
import { useHistory, useParams } from "react-router-dom";
|
||||
import { Invites, Servers } from "revolt.js/dist/api/objects";
|
||||
import { RetrievedInvite } from "revolt-api/types/Invites";
|
||||
|
||||
import styles from "./Invite.module.scss";
|
||||
import { useContext, useEffect, useState } from "preact/hooks";
|
||||
|
||||
import { defer } from "../../lib/defer";
|
||||
|
||||
import { useData } from "../../mobx/State";
|
||||
|
||||
import RequiresOnline from "../../context/revoltjs/RequiresOnline";
|
||||
import {
|
||||
AppContext,
|
||||
@@ -26,14 +23,13 @@ import Overline from "../../components/ui/Overline";
|
||||
import Preloader from "../../components/ui/Preloader";
|
||||
|
||||
export default function Invite() {
|
||||
const store = useData();
|
||||
const history = useHistory();
|
||||
const client = useContext(AppContext);
|
||||
const status = useContext(StatusContext);
|
||||
const { code } = useParams<{ code: string }>();
|
||||
const [processing, setProcessing] = useState(false);
|
||||
const [error, setError] = useState<string | undefined>(undefined);
|
||||
const [invite, setInvite] = useState<Invites.RetrievedInvite | undefined>(
|
||||
const [invite, setInvite] = useState<RetrievedInvite | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
@@ -122,7 +118,7 @@ export default function Invite() {
|
||||
}
|
||||
|
||||
const dispose = autorun(() => {
|
||||
let server = store.servers.get(
|
||||
let server = client.servers.get(
|
||||
invite.server_id,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user