mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-22 15:10:57 -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 { Form } from "./Form";
|
||||||
|
import { detect } from "detect-browser";
|
||||||
|
import { useContext } from "preact/hooks";
|
||||||
|
import { OperationsContext } from "../../../context/revoltjs/RevoltClient";
|
||||||
|
|
||||||
export function FormLogin() {
|
export function FormLogin() {
|
||||||
const { login } = useContext(OperationsContext);
|
const { login } = useContext(OperationsContext);
|
||||||
|
@ -14,15 +10,21 @@ export function FormLogin() {
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
page="login"
|
page="login"
|
||||||
callback={async (data) => {
|
callback={async data => {
|
||||||
const browser = detect();
|
const browser = detect();
|
||||||
let device_name;
|
let device_name;
|
||||||
if (browser) {
|
if (browser) {
|
||||||
const { name, os } = browser;
|
let { name } = browser;
|
||||||
|
const { os } = browser;
|
||||||
if (window.isNative) {
|
if (window.isNative) {
|
||||||
device_name = `Revolt Desktop on ${os}`;
|
device_name = `Revolt Desktop on ${os}`;
|
||||||
} else {
|
} else {
|
||||||
device_name = `${name} on ${os}`;
|
if(name === "ios") {
|
||||||
|
name = "safari";
|
||||||
|
}else if(name === "fxios") {
|
||||||
|
name = "firefox";
|
||||||
|
}
|
||||||
|
device_name = `${name} on ${os}`;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
device_name = "Unknown Device";
|
device_name = "Unknown Device";
|
||||||
|
|
Loading…
Reference in a new issue