File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import initI18N from './i18n'
14
14
15
15
import App from './views/Index.svelte'
16
16
import type { InitOptions , OnboardAPI } from './types'
17
- import { device } from './utils'
17
+ import { getDevice } from './utils'
18
18
19
19
const API = {
20
20
connectWallet,
@@ -58,6 +58,8 @@ function init(options: InitOptions): OnboardAPI {
58
58
59
59
let accountCenterUpdate
60
60
61
+ const device = getDevice ( )
62
+
61
63
if ( device . type === 'mobile' ) {
62
64
accountCenterUpdate = {
63
65
enabled : false
Original file line number Diff line number Diff line change @@ -25,15 +25,17 @@ import arbitrumIcon from './icons/arbitrum'
25
25
26
26
import type { ChainStyle , ConnectedChain } from './types'
27
27
28
- const parsed = bowser . getParser ( window . navigator . userAgent )
29
- const os = parsed . getOS ( )
30
- const browser = parsed . getBrowser ( )
31
- const { type } = parsed . getPlatform ( )
32
-
33
- export const device : Device = {
34
- type : type as DeviceType ,
35
- os : os as DeviceOS ,
36
- browser : browser as DeviceBrowser
28
+ export function getDevice ( ) : Device {
29
+ const parsed = bowser . getParser ( window . navigator . userAgent )
30
+ const os = parsed . getOS ( )
31
+ const browser = parsed . getBrowser ( )
32
+ const { type } = parsed . getPlatform ( )
33
+
34
+ return {
35
+ type : type as DeviceType ,
36
+ os : os as DeviceOS ,
37
+ browser : browser as DeviceBrowser
38
+ }
37
39
}
38
40
39
41
export const notNullish = < T > ( value : T | null | undefined ) : value is T =>
You can’t perform that action at this time.
0 commit comments