mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 16:16:48 +00:00
(feat:utils) getOS, isTouchDevice
This commit is contained in:
1 parent
6cb4577e1b
commit
b4c6b2b08b
1 file changed
+10
@@ -0,0 +1,10 @@
|
|||||||
|
export function getOS() {
|
||||||
|
const userAgent = window.navigator.userAgent;
|
||||||
|
if (userAgent.indexOf('Mac') !== -1) return 'mac';
|
||||||
|
if (userAgent.indexOf('Win') !== -1) return 'win';
|
||||||
|
return 'linux';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isTouchDevice() {
|
||||||
|
return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user