mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-21 21:32:13 +01:00
Fix macOS detect for docsite (#1314)
This commit is contained in:
parent
79f516d473
commit
31975983c3
@ -16,14 +16,14 @@ export const PlatformContext = createContext<PlatformContextProps | undefined>(u
|
||||
|
||||
const detectPlatform = (): Platform => {
|
||||
const savedPlatform = localStorage.getItem("platform") as Platform | null;
|
||||
if (savedPlatform && (savedPlatform === "mac" || savedPlatform === "linux")) {
|
||||
if (savedPlatform) {
|
||||
return savedPlatform;
|
||||
}
|
||||
const { os } = UAParser(navigator.userAgent);
|
||||
|
||||
if (/Windows/.test(os.name)) {
|
||||
return "windows";
|
||||
} else if (/macOS|iOS/.test(os.name)) {
|
||||
} else if (/Mac OS|iOS/.test(os.name)) {
|
||||
return "mac";
|
||||
} else {
|
||||
return "linux";
|
||||
|
Loading…
Reference in New Issue
Block a user