diff --git a/.changeset/fix-macos-casing.md b/.changeset/fix-macos-casing.md new file mode 100644 index 000000000..735318ab4 --- /dev/null +++ b/.changeset/fix-macos-casing.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix Mac OS to macOS in the the devices tab diff --git a/src/app/utils/user-agent.ts b/src/app/utils/user-agent.ts index 0e82daf0e..e1a2e0a61 100644 --- a/src/app/utils/user-agent.ts +++ b/src/app/utils/user-agent.ts @@ -9,6 +9,12 @@ const isMobileOrTablet = (() => { return false; })(); +const normalizeMacName = (os?: string) => { + if (!os) return os; + if (os === 'Mac OS') return 'macOS'; + return os; +}; + const isMac = result.os.name === 'Mac OS'; export const ua = () => result; @@ -17,7 +23,7 @@ export const mobileOrTablet = () => isMobileOrTablet; export const deviceDisplayName = (): string => { const browser = result.browser.name; - const os = result.os.name; + const os = normalizeMacName(result.os.name); if (!browser || !os) return 'Sable Web'; return `Sable on ${browser} for ${os}`; };