mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-25 08:30:58 -05:00
fix: properly detect ipados (#504)
This commit is contained in:
parent
eea4d49743
commit
5a46c50b81
2 changed files with 7 additions and 2 deletions
|
@ -21,6 +21,7 @@ export function FormLogin() {
|
||||||
if (browser) {
|
if (browser) {
|
||||||
let { name } = browser;
|
let { name } = browser;
|
||||||
const { os } = browser;
|
const { os } = browser;
|
||||||
|
let isiPad;
|
||||||
if (window.isNative) {
|
if (window.isNative) {
|
||||||
friendly_name = `Revolt Desktop on ${os}`;
|
friendly_name = `Revolt Desktop on ${os}`;
|
||||||
} else {
|
} else {
|
||||||
|
@ -28,8 +29,12 @@ export function FormLogin() {
|
||||||
name = "safari";
|
name = "safari";
|
||||||
} else if (name === "fxios") {
|
} else if (name === "fxios") {
|
||||||
name = "firefox";
|
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 {
|
} else {
|
||||||
friendly_name = "Unknown Device";
|
friendly_name = "Unknown Device";
|
||||||
|
|
|
@ -92,7 +92,7 @@ export function Sessions() {
|
||||||
return <Android size={14} />;
|
return <Android size={14} />;
|
||||||
case /mac.*os/i.test(name):
|
case /mac.*os/i.test(name):
|
||||||
return <Macos size={14} />;
|
return <Macos size={14} />;
|
||||||
case /ios/i.test(name):
|
case /i(Pad)os/i.test(name):
|
||||||
return <Apple size={14} />;
|
return <Apple size={14} />;
|
||||||
case /windows/i.test(name):
|
case /windows/i.test(name):
|
||||||
return <Windows size={14} />;
|
return <Windows size={14} />;
|
||||||
|
|
Loading…
Reference in a new issue