Skip to content

Commit 76f6160

Browse files
committed
fix(utils): fix isPC
1 parent 599db44 commit 76f6160

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils/agent.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export function isPC() {
22
const agents = ['Android', 'iPhone', 'webOS', 'BlackBerry', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];
33

4-
return !agents.includes(window.navigator.userAgent);
4+
const isMobile = agents.some(agent => window.navigator.userAgent.includes(agent));
5+
6+
return !isMobile;
57
}

0 commit comments

Comments
 (0)