MCPcopy Create free account
hub / github.com/tiann/hapi / usePlatform

Function usePlatform

web/src/hooks/usePlatform.ts:70–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68}
69
70export function usePlatform(): Platform {
71 const isTelegram = useMemo(() => isTelegramApp(), [])
72 const isTouch = useMemo(
73 () => typeof window !== 'undefined' && window.matchMedia('(pointer: coarse)').matches,
74 []
75 )
76
77 return {
78 isTelegram,
79 isTouch,
80 haptic
81 }
82}
83
84// Non-hook version for use outside React components
85export function getPlatform(): Platform {

Callers 11

InstallPromptFunction · 0.90
SessionChatInnerFunction · 0.90
SessionItemFunction · 0.90
HappyComposerFunction · 0.90
NewSessionFunction · 0.90
RequestUserInputFooterFunction · 0.90
PermissionFooterFunction · 0.90
AskUserQuestionFooterFunction · 0.90
useCopyToClipboardFunction · 0.90
useSendMessageFunction · 0.90
useCancelQueuedMessageFunction · 0.90

Calls 1

isTelegramAppFunction · 0.90

Tested by

no test coverage detected