From a08ad7aa0b09e10216bf24df15e7b3d5fa3bf05d Mon Sep 17 00:00:00 2001 From: Ryan Alexander <38785445+ryanalexander@users.noreply.github.com> Date: Fri, 3 Sep 2021 19:35:02 +1000 Subject: [PATCH] Rename "ios" & "fxios" to "Safari" and "Firefox" for browser name (#119) --- src/pages/login/forms/FormLogin.tsx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/pages/login/forms/FormLogin.tsx b/src/pages/login/forms/FormLogin.tsx index b7d47fd2..dda21f87 100644 --- a/src/pages/login/forms/FormLogin.tsx +++ b/src/pages/login/forms/FormLogin.tsx @@ -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 (
{ + 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";