mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-02-17 17:50:19 +08:00
[ADDED] MacOS detect
This commit is contained in:
parent
144200e315
commit
3bfcdf9c41
12
app/utils.ts
12
app/utils.ts
@ -173,3 +173,15 @@ export function autoGrowTextArea(dom: HTMLTextAreaElement) {
|
|||||||
export function getCSSVar(varName: string) {
|
export function getCSSVar(varName: string) {
|
||||||
return getComputedStyle(document.body).getPropertyValue(varName).trim();
|
return getComputedStyle(document.body).getPropertyValue(varName).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detects if the Operation system is MacOS
|
||||||
|
*/
|
||||||
|
export function isMacOS(): boolean {
|
||||||
|
if (window !== 'undefined') {
|
||||||
|
let userAgent = window?.navigator?.userAgent
|
||||||
|
if (userAgent.indexOf('Mac') != -1) return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user