fix: properly detect ipados (#504)

This commit is contained in:
Ed L 2022-01-14 16:53:53 +00:00 committed by GitHub
parent eea4d49743
commit 5a46c50b81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -21,6 +21,7 @@ export function FormLogin() {
if (browser) {
let { name } = browser;
const { os } = browser;
let isiPad;
if (window.isNative) {
friendly_name = `Revolt Desktop on ${os}`;
} else {
@ -28,8 +29,12 @@ export function FormLogin() {
name = "safari";
} else if (name === "fxios") {
name = "firefox";
} else if (name === "crios") {
name = "chrome";
}
friendly_name = `${name} on ${os}`;
if (os === "Mac OS" && navigator.maxTouchPoints > 0)
isiPad = true;
friendly_name = `${name} on ${isiPad ? "iPadOS" : os}`;
}
} else {
friendly_name = "Unknown Device";

View file

@ -92,7 +92,7 @@ export function Sessions() {
return <Android size={14} />;
case /mac.*os/i.test(name):
return <Macos size={14} />;
case /ios/i.test(name):
case /i(Pad)os/i.test(name):
return <Apple size={14} />;
case /windows/i.test(name):
return <Windows size={14} />;