mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-10 01:03:36 -05:00
Rename "ios" & "fxios" to "Safari" and "Firefox" for browser name (#119)
This commit is contained in:
parent
c302eade17
commit
a08ad7aa0b
1 changed files with 12 additions and 10 deletions
|
@ -1,11 +1,7 @@
|
|||
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";
|
||||
import { detect } from "detect-browser";
|
||||
import { useContext } from "preact/hooks";
|
||||
import { OperationsContext } from "../../../context/revoltjs/RevoltClient";
|
||||
|
||||
export function FormLogin() {
|
||||
const { login } = useContext(OperationsContext);
|
||||
|
@ -14,15 +10,21 @@ export function FormLogin() {
|
|||
return (
|
||||
<Form
|
||||
page="login"
|
||||
callback={async (data) => {
|
||||
callback={async data => {
|
||||
const browser = detect();
|
||||
let device_name;
|
||||
if (browser) {
|
||||
const { name, os } = browser;
|
||||
let { name } = browser;
|
||||
const { os } = browser;
|
||||
if (window.isNative) {
|
||||
device_name = `Revolt Desktop on ${os}`;
|
||||
} else {
|
||||
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";
|
||||
|
|
Loading…
Reference in a new issue