Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-macos-casing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Fix Mac OS to macOS in the the devices tab
8 changes: 7 additions & 1 deletion src/app/utils/user-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}`;
};
Loading