mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-22 15:10:57 -05:00
Attempt to fix no permission on server.
This commit is contained in:
parent
25fa375ce0
commit
781fa5de10
1 changed files with 8 additions and 3 deletions
|
@ -5,6 +5,8 @@ import { Invites } from "revolt.js/dist/api/objects";
|
||||||
import styles from "./Invite.module.scss";
|
import styles from "./Invite.module.scss";
|
||||||
import { useContext, useEffect, useState } from "preact/hooks";
|
import { useContext, useEffect, useState } from "preact/hooks";
|
||||||
|
|
||||||
|
import { defer } from "../../lib/defer";
|
||||||
|
|
||||||
import RequiresOnline from "../../context/revoltjs/RequiresOnline";
|
import RequiresOnline from "../../context/revoltjs/RequiresOnline";
|
||||||
import {
|
import {
|
||||||
AppContext,
|
AppContext,
|
||||||
|
@ -118,10 +120,13 @@ export default function Invite() {
|
||||||
const result = await client.joinInvite(
|
const result = await client.joinInvite(
|
||||||
code,
|
code,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result.type === "Server") {
|
if (result.type === "Server") {
|
||||||
|
defer(() => {
|
||||||
history.push(
|
history.push(
|
||||||
`/server/${result.server._id}/channel/${result.channel._id}`,
|
`/server/${result.server._id}/channel/${result.channel._id}`,
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(takeError(err));
|
setError(takeError(err));
|
||||||
|
|
Loading…
Reference in a new issue