Skip to content

Commit

Permalink
Added callbacks for logging identity creation and enabling
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed Dec 21, 2023
1 parent 4879782 commit f64420f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion example/src/LaunchScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function LaunchScreen({
const { setClient } = useXmtp()
const savedKeys = useSavedKeys()
const configureWallet = useCallback(
(label: string, configuring: Promise<XMTP.Client>) => {
(label: string, configuring: Promise<XMTP.Client<any>>) => {
console.log('Connecting XMTP client', label)
configuring
.then(async (client) => {
Expand All @@ -44,12 +44,23 @@ export default function LaunchScreen({
},
[]
)

const preCreateIdentityCallback = () => {
console.log("Pre Create Identity Callback")

Check warning on line 49 in example/src/LaunchScreen.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `"Pre·Create·Identity·Callback"` with `'Pre·Create·Identity·Callback'`
}

const preEnableIdentityCallback = () => {
console.log("Pre Enable Identity Callback")

Check warning on line 53 in example/src/LaunchScreen.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `"Pre·Enable·Identity·Callback"` with `'Pre·Enable·Identity·Callback'`
}

useEffect(() => {
(async () => {

Check warning on line 57 in example/src/LaunchScreen.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `;`
if (signer) {
configureWallet('dev', XMTP.Client.create(signer, {

Check warning on line 59 in example/src/LaunchScreen.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `'dev',` with `⏎··········'dev',⏎·········`
env: 'dev',

Check warning on line 60 in example/src/LaunchScreen.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `··`
appVersion,

Check warning on line 61 in example/src/LaunchScreen.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `··········` with `············`
preCreateIdentityCallback,

Check warning on line 62 in example/src/LaunchScreen.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `··`
preEnableIdentityCallback,
}))
}
})()
Expand Down Expand Up @@ -102,6 +113,8 @@ export default function LaunchScreen({
env: 'dev',
appVersion,
codecs: supportedCodecs,
preCreateIdentityCallback,
preEnableIdentityCallback,
})
)
}}
Expand All @@ -118,6 +131,8 @@ export default function LaunchScreen({
env: 'local',
appVersion,
codecs: supportedCodecs,
preCreateIdentityCallback,
preEnableIdentityCallback,
})
)
}}
Expand Down

0 comments on commit f64420f

Please sign in to comment.