Skip to content

Commit

Permalink
Merge pull request #30 from argentlabs/fix/check-inapp-browser
Browse files Browse the repository at this point in the history
fix: expose check for argent mobile inApp browser
  • Loading branch information
bluecco authored Nov 21, 2023
2 parents 90245ac + 3bf3b17 commit 8995456
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 8995456

Please sign in to comment.