mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-25 00:20:57 -05:00
Merge branch 'master' into chore/component-migration
This commit is contained in:
commit
6497e11fb0
5 changed files with 27 additions and 29 deletions
2
external/lang
vendored
2
external/lang
vendored
|
@ -1 +1 @@
|
|||
Subproject commit e010e46ee9f226373a253c351b50ccdeea1c8b50
|
||||
Subproject commit 1394a127994951e19603be77ce2233c8133e3a81
|
|
@ -9,6 +9,7 @@ import { Preloader } from "@revoltchat/ui";
|
|||
|
||||
import { useApplicationState } from "../../mobx/State";
|
||||
|
||||
import Preloader from "../../components/ui/Preloader";
|
||||
import { Children } from "../../types/Preact";
|
||||
import { useIntermediate } from "../intermediate/Intermediate";
|
||||
import { registerEvents } from "./events";
|
||||
|
@ -80,6 +81,7 @@ export default observer(({ children }: Props) => {
|
|||
}, [state.auth.getSession()]);
|
||||
|
||||
useEffect(() => registerEvents(state, setStatus, client), [client]);
|
||||
useEffect(() => state.registerListeners(client), [client]);
|
||||
|
||||
if (!loaded || status === ClientStatus.LOADING) {
|
||||
return <Preloader type="spinner" />;
|
||||
|
|
|
@ -22,9 +22,6 @@ export default function SyncManager() {
|
|||
}
|
||||
}, [client]);
|
||||
|
||||
// Keep data synced.
|
||||
useEffect(() => state.registerListeners(client), [client]);
|
||||
|
||||
// Take data updates from Revolt.
|
||||
useEffect(() => {
|
||||
if (!client) return;
|
||||
|
|
|
@ -7,12 +7,12 @@ import { Children } from "../../types/Preact";
|
|||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function takeError(error: any): string {
|
||||
if (error.response) {
|
||||
const status = error.response.status;
|
||||
if (error.response.type) {
|
||||
return error.response.type;
|
||||
const type = error.response.data?.type;
|
||||
if (type) {
|
||||
return type;
|
||||
}
|
||||
|
||||
switch (status) {
|
||||
switch (error.response.status) {
|
||||
case 429:
|
||||
return "TooManyRequests";
|
||||
case 401:
|
||||
|
|
|
@ -174,13 +174,9 @@ export const Account = observer(() => {
|
|||
</h3>
|
||||
<h5>
|
||||
{/*<Text id="app.settings.pages.account.2fa.description" />*/}
|
||||
Two-factor authentication is currently work-in-progress, see{" "}
|
||||
{` `}
|
||||
<a
|
||||
href="https://github.com/insertish/rauth/milestone/1"
|
||||
target="_blank"
|
||||
rel="noreferrer">
|
||||
v1 milestone here
|
||||
Two-factor authentication is currently in-development, see{" "}
|
||||
<a href="https://github.com/revoltchat/revite/issues/675">
|
||||
tracking issue here
|
||||
</a>
|
||||
.
|
||||
</h5>
|
||||
|
@ -208,23 +204,26 @@ export const Account = observer(() => {
|
|||
<CategoryButton
|
||||
icon={<Block size={24} color="var(--error)" />}
|
||||
description={
|
||||
"Disable your account. You won't be able to access it unless you log back in."
|
||||
"Disable your account. You won't be able to access it unless you contact support."
|
||||
}
|
||||
disabled
|
||||
action={<Text id="general.unavailable" />}>
|
||||
action="chevron"
|
||||
onClick={() => {
|
||||
//
|
||||
}}>
|
||||
<Text id="app.settings.pages.account.manage.disable" />
|
||||
</CategoryButton>
|
||||
<a href="mailto:contact@revolt.chat?subject=Delete%20my%20account">
|
||||
<CategoryButton
|
||||
icon={<Trash size={24} color="var(--error)" />}
|
||||
description={
|
||||
"Delete your account, including all of your data. (sends an email to contact@revolt.chat)"
|
||||
}
|
||||
action="external">
|
||||
<Text id="app.settings.pages.account.manage.delete" />
|
||||
</CategoryButton>
|
||||
</a>
|
||||
<LineDivider />
|
||||
<CategoryButton
|
||||
icon={<Trash size={24} color="var(--error)" />}
|
||||
description={
|
||||
"Your account will be queued for deletion, a confirmation email will be sent."
|
||||
}
|
||||
hover
|
||||
action="chevron"
|
||||
onClick={() => {
|
||||
//
|
||||
}}>
|
||||
<Text id="app.settings.pages.account.manage.delete" />
|
||||
</CategoryButton>
|
||||
<Tip>
|
||||
<span>
|
||||
<Text id="app.settings.tips.account.a" />
|
||||
|
|
Loading…
Reference in a new issue