mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 17:11:17 -08:00
Merge pull request #328 from DidiDidi129/dev
Fix macOS name in the devices tab from 'Mac OS' to 'macOS'
This commit is contained in:
2 files changed
+12
-1
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
default: patch
|
||||
---
|
||||
|
||||
Fix Mac OS to macOS in the the devices tab
|
||||
@@ -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}`;
|
||||
};
|
||||
Reference in new issue
Block a user