Merge branch 'master' into chore/component-migration

This commit is contained in:
Paul Makles 2022-06-09 14:48:45 +01:00 committed by GitHub
commit 6497e11fb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 29 deletions

2
external/lang vendored

@ -1 +1 @@
Subproject commit e010e46ee9f226373a253c351b50ccdeea1c8b50 Subproject commit 1394a127994951e19603be77ce2233c8133e3a81

View file

@ -9,6 +9,7 @@ import { Preloader } from "@revoltchat/ui";
import { useApplicationState } from "../../mobx/State"; import { useApplicationState } from "../../mobx/State";
import Preloader from "../../components/ui/Preloader";
import { Children } from "../../types/Preact"; import { Children } from "../../types/Preact";
import { useIntermediate } from "../intermediate/Intermediate"; import { useIntermediate } from "../intermediate/Intermediate";
import { registerEvents } from "./events"; import { registerEvents } from "./events";
@ -80,6 +81,7 @@ export default observer(({ children }: Props) => {
}, [state.auth.getSession()]); }, [state.auth.getSession()]);
useEffect(() => registerEvents(state, setStatus, client), [client]); useEffect(() => registerEvents(state, setStatus, client), [client]);
useEffect(() => state.registerListeners(client), [client]);
if (!loaded || status === ClientStatus.LOADING) { if (!loaded || status === ClientStatus.LOADING) {
return <Preloader type="spinner" />; return <Preloader type="spinner" />;

View file

@ -22,9 +22,6 @@ export default function SyncManager() {
} }
}, [client]); }, [client]);
// Keep data synced.
useEffect(() => state.registerListeners(client), [client]);
// Take data updates from Revolt. // Take data updates from Revolt.
useEffect(() => { useEffect(() => {
if (!client) return; if (!client) return;

View file

@ -7,12 +7,12 @@ import { Children } from "../../types/Preact";
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
export function takeError(error: any): string { export function takeError(error: any): string {
if (error.response) { if (error.response) {
const status = error.response.status; const type = error.response.data?.type;
if (error.response.type) { if (type) {
return error.response.type; return type;
} }
switch (status) { switch (error.response.status) {
case 429: case 429:
return "TooManyRequests"; return "TooManyRequests";
case 401: case 401:

View file

@ -174,13 +174,9 @@ export const Account = observer(() => {
</h3> </h3>
<h5> <h5>
{/*<Text id="app.settings.pages.account.2fa.description" />*/} {/*<Text id="app.settings.pages.account.2fa.description" />*/}
Two-factor authentication is currently work-in-progress, see{" "} Two-factor authentication is currently in-development, see{" "}
{` `} <a href="https://github.com/revoltchat/revite/issues/675">
<a tracking issue here
href="https://github.com/insertish/rauth/milestone/1"
target="_blank"
rel="noreferrer">
v1 milestone here
</a> </a>
. .
</h5> </h5>
@ -208,23 +204,26 @@ export const Account = observer(() => {
<CategoryButton <CategoryButton
icon={<Block size={24} color="var(--error)" />} icon={<Block size={24} color="var(--error)" />}
description={ 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="chevron"
action={<Text id="general.unavailable" />}> onClick={() => {
//
}}>
<Text id="app.settings.pages.account.manage.disable" /> <Text id="app.settings.pages.account.manage.disable" />
</CategoryButton> </CategoryButton>
<a href="mailto:contact@revolt.chat?subject=Delete%20my%20account"> <CategoryButton
<CategoryButton icon={<Trash size={24} color="var(--error)" />}
icon={<Trash size={24} color="var(--error)" />} description={
description={ "Your account will be queued for deletion, a confirmation email will be sent."
"Delete your account, including all of your data. (sends an email to contact@revolt.chat)" }
} hover
action="external"> action="chevron"
<Text id="app.settings.pages.account.manage.delete" /> onClick={() => {
</CategoryButton> //
</a> }}>
<LineDivider /> <Text id="app.settings.pages.account.manage.delete" />
</CategoryButton>
<Tip> <Tip>
<span> <span>
<Text id="app.settings.tips.account.a" /> <Text id="app.settings.tips.account.a" />