forked from XiaoMo/ChatGPT-Next-Web
[FIXED] now it should detects all macintosh
This commit is contained in:
parent
f3d5fc7a84
commit
f1ca03e378
10
app/utils.ts
10
app/utils.ts
@ -175,13 +175,13 @@ export function getCSSVar(varName: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detects if the Operation system is MacOS
|
* Detects Macintosh
|
||||||
*/
|
*/
|
||||||
export function isMacOS(): boolean {
|
export function isMacOS(): boolean {
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
let userAgent = window?.navigator?.userAgent;
|
let userAgent = window.navigator.userAgent.toLocaleLowerCase();
|
||||||
if (userAgent.indexOf("Mac") != -1) return true;
|
const macintosh = /iphone|ipad|ipod|macintosh/.test(userAgent)
|
||||||
|
return !!macintosh
|
||||||
}
|
}
|
||||||
|
return false
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user