Skip to content

Commit

Permalink
fix: expose check for argent mobile inApp browser
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecco committed Nov 14, 2023
1 parent 90245ac commit 3bf3b17
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/connectors/argentMobile/helpers/inAppBrowser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { StarknetWindowObject } from "get-starknet-core"

export const isInArgentMobileAppBrowser = (): boolean => {
if (!window?.starknet_argentX) {
return false
}

const starknetMobile = window?.starknet_argentX as StarknetWindowObject & {
isInAppBrowser: boolean
}

return starknetMobile?.isInAppBrowser
}
1 change: 1 addition & 0 deletions src/connectors/argentMobile/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./inAppBrowser"
2 changes: 2 additions & 0 deletions src/connectors/argentMobile/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,5 @@ export class ArgentMobileConnector extends Connector {
})
}
}

export { isInArgentMobileAppBrowser } from "./helpers"

0 comments on commit 3bf3b17

Please sign in to comment.