Merge pull request #328 from DidiDidi129/dev

Fix macOS name in the devices tab from 'Mac OS' to 'macOS'
This commit is contained in:
Rose authored and GitHub committed 2026-03-17 15:06:25 +00:00
commit 9ed985a2a8
2 files changed
+12 -1

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
default: patch
---
Fix Mac OS to macOS in the the devices tab
+7 -1
View File
@@ -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}`;
};