@@ -2,28 +2,12 @@ import {
22 StarknetkitCompoundConnector ,
33 StarknetkitConnector ,
44} from "../connectors"
5- import {
6- type ArgentMobileConnectorOptions ,
7- } from "../connectors/argent/argentMobile"
5+ import { type ArgentMobileConnectorOptions } from "../connectors/argent/argentMobile"
86import { BraavosMobileBaseConnector } from "../connectors/braavosMobile"
97import { WebWalletConnector } from "../connectors/webwallet"
108import { Braavos } from "../connectors/injected/braavos"
119import { Argent } from "../connectors/argent"
12-
13- const isMobileDevice = ( ) => {
14- // Primary method: User Agent + Touch support check
15- const userAgent = navigator . userAgent . toLowerCase ( )
16- const isMobileUA =
17- / a n d r o i d | w e b o s | i p h o n e | i p a d | i p o d | b l a c k b e r r y | w i n d o w s p h o n e / . test ( userAgent )
18- const hasTouchSupport =
19- "ontouchstart" in window || navigator . maxTouchPoints > 0
20-
21- // Backup method: Screen size
22- const isSmallScreen = window . innerWidth <= 768
23-
24- // Combine checks: Must match user agent AND (touch support OR small screen)
25- return isMobileUA && ( hasTouchSupport || isSmallScreen )
26- }
10+ import { isMobileDevice , isSafari } from "./navigator"
2711
2812export const defaultConnectors = ( {
2913 argentMobileOptions,
@@ -32,19 +16,14 @@ export const defaultConnectors = ({
3216 argentMobileOptions : ArgentMobileConnectorOptions
3317 webWalletUrl ?: string
3418} ) : ( StarknetkitConnector | StarknetkitCompoundConnector ) [ ] => {
35- const isSafari =
36- typeof window !== "undefined"
37- ? / ^ ( (? ! c h r o m e | a n d r o i d ) .) * s a f a r i / i. test ( navigator . userAgent )
38- : false
39-
4019 const defaultConnectors : (
4120 | StarknetkitConnector
4221 | StarknetkitCompoundConnector
4322 ) [ ] = [ ]
4423
4524 defaultConnectors . push ( new Argent ( { mobile : argentMobileOptions } ) )
4625
47- if ( ! isSafari ) {
26+ if ( ! isSafari ( ) ) {
4827 defaultConnectors . push ( new Braavos ( ) )
4928 }
5029
0 commit comments