mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-26 04:04:29 +08:00

* fix: date time value retain on location switch * chore: added inline comments * feat: added shortcut strings based on user os * feat: added shortcut strings based on user os * feat: added shortcut strings based on user os
15 lines
401 B
TypeScript
15 lines
401 B
TypeScript
export enum UserOperatingSystem {
|
|
WINDOWS = 'Windows',
|
|
MACOS = 'Mac OS',
|
|
}
|
|
|
|
export function getUserOperatingSystem(): UserOperatingSystem {
|
|
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent
|
|
if (window.navigator.userAgent.indexOf(UserOperatingSystem.WINDOWS) !== -1) {
|
|
return UserOperatingSystem.WINDOWS;
|
|
}
|
|
|
|
// default return is MacOS
|
|
return UserOperatingSystem.MACOS;
|
|
}
|