Fix and prettier incoming changes from PR #119.

Cherry pick PR #130: don't show add friend button on banned / deleted accounts.
Also account for this in context menu.
This commit is contained in:
Paul
2021-09-03 10:43:48 +01:00
parent 25e49b63fa
commit bd54c341b9
3 changed files with 34 additions and 14 deletions

View File

@@ -1,8 +1,12 @@
import { Form } from "./Form";
import { detect } from "detect-browser";
import { useHistory } from "react-router-dom";
import { useContext } from "preact/hooks";
import { OperationsContext } from "../../../context/revoltjs/RevoltClient";
import { Form } from "./Form";
export function FormLogin() {
const { login } = useContext(OperationsContext);
const history = useHistory();
@@ -10,7 +14,7 @@ export function FormLogin() {
return (
<Form
page="login"
callback={async data => {
callback={async (data) => {
const browser = detect();
let device_name;
if (browser) {
@@ -19,12 +23,12 @@ export function FormLogin() {
if (window.isNative) {
device_name = `Revolt Desktop on ${os}`;
} else {
if(name === "ios") {
name = "safari";
}else if(name === "fxios") {
name = "firefox";
}
device_name = `${name} on ${os}`;
if (name === "ios") {
name = "safari";
} else if (name === "fxios") {
name = "firefox";
}
device_name = `${name} on ${os}`;
}
} else {
device_name = "Unknown Device";