From b0cac57bb0996e89718f800d803b0683b3161c1f Mon Sep 17 00:00:00 2001 From: Ali Josheghani Date: Tue, 10 Sep 2024 11:46:58 +0330 Subject: [PATCH] Refactor: Remove getOS function The getOS function, which was used to detect the operating system, has been removed from the codebase. This function was previously using the navigator.userAgent property to determine the OS. However, it is no longer needed and has been deleted. This commit refactors the code by removing the getOS function entirely. Ref: Issue #123 --- src/utils/helper/getOs.ts | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 src/utils/helper/getOs.ts diff --git a/src/utils/helper/getOs.ts b/src/utils/helper/getOs.ts deleted file mode 100644 index 791549d..0000000 --- a/src/utils/helper/getOs.ts +++ /dev/null @@ -1,12 +0,0 @@ -export const getOS = () => { - if (typeof navigator !== "undefined") { - const userAgent = navigator.userAgent; - if (/android/i.test(userAgent)) return "Android"; - if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) return "iOS"; - if (userAgent.indexOf("Win") !== -1) return "Windows"; - if (userAgent.indexOf("Mac") !== -1) return "MacOS"; - if (userAgent.indexOf("X11") !== -1) return "UNIX"; - if (userAgent.indexOf("Linux") !== -1) return "Linux"; - } - return "Unknown OS"; -};