mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
fix(home,settings): updated homepage, settings
* new home screen * cleaned up settings
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Chrome, Android, Apple, Windows } from "@styled-icons/boxicons-logos";
|
||||
import { HelpCircle, Desktop } from "@styled-icons/boxicons-regular";
|
||||
import { HelpCircle, Desktop, LogOut } from "@styled-icons/boxicons-regular";
|
||||
import {
|
||||
Safari,
|
||||
Firefoxbrowser,
|
||||
@@ -24,6 +24,7 @@ import { AppContext } from "../../../context/revoltjs/RevoltClient";
|
||||
import Button from "../../../components/ui/Button";
|
||||
import Preloader from "../../../components/ui/Preloader";
|
||||
import Tip from "../../../components/ui/Tip";
|
||||
import CategoryButton from "../../../components/ui/fluent/CategoryButton";
|
||||
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
@@ -207,7 +208,7 @@ export function Sessions() {
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
<Button
|
||||
{/*<Button
|
||||
error
|
||||
onClick={async () => {
|
||||
// ! FIXME: add to rAuth
|
||||
@@ -230,7 +231,37 @@ export function Sessions() {
|
||||
setSessions(sessions.filter((x) => x._id === deviceId));
|
||||
}}>
|
||||
<Text id="app.settings.pages.sessions.logout" />
|
||||
</Button>
|
||||
</Button>*/}
|
||||
|
||||
<CategoryButton
|
||||
onClick={async () => {
|
||||
// ! FIXME: add to rAuth
|
||||
const del: string[] = [];
|
||||
render.forEach((session) => {
|
||||
if (deviceId !== session._id) {
|
||||
del.push(session._id);
|
||||
}
|
||||
});
|
||||
|
||||
setDelete(del);
|
||||
|
||||
for (const id of del) {
|
||||
await client.req(
|
||||
"DELETE",
|
||||
`/auth/session/${id}` as "/auth/session/id",
|
||||
);
|
||||
}
|
||||
|
||||
setSessions(sessions.filter((x) => x._id === deviceId));
|
||||
}}
|
||||
icon={<LogOut size={24} color={"var(--error)"} />}
|
||||
action={"chevron"}
|
||||
description={
|
||||
"Logs you out of all sessions except this device."
|
||||
}>
|
||||
<Text id="app.settings.pages.sessions.logout" />
|
||||
</CategoryButton>
|
||||
|
||||
<Tip>
|
||||
<span>
|
||||
<Text id="app.settings.tips.sessions.a" />
|
||||
|
||||
Reference in New Issue
Block a user