diff --git a/frontend/src/utils/utils.ts b/frontend/src/utils/utils.ts index 082a3647..2b378326 100644 --- a/frontend/src/utils/utils.ts +++ b/frontend/src/utils/utils.ts @@ -238,3 +238,15 @@ export const cleanPlatformFlag = () => { wsCache.delete(platformKey) return false } +export function isTablet() { + const userAgent = navigator.userAgent + const tabletRegex = /iPad|Silk|Galaxy Tab|PlayBook|BlackBerry|(tablet|ipad|playbook)/i + return tabletRegex.test(userAgent) +} +export function isMobile() { + return ( + navigator.userAgent.match( + /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i + ) && !isTablet() + ) +} diff --git a/frontend/src/views/chat/index.vue b/frontend/src/views/chat/index.vue index 3456c73c..184f4362 100644 --- a/frontend/src/views/chat/index.vue +++ b/frontend/src/views/chat/index.vue @@ -4,6 +4,7 @@ :width="280" placement="bottom-start" popper-class="popover-chat_history popover-chat_history_small" + :disabled="isPhone" >