Skip to content

Commit

Permalink
chore: maintain token dev state
Browse files Browse the repository at this point in the history
  • Loading branch information
devceline committed Mar 8, 2024
1 parent 09d2905 commit 32cafe7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@tanstack/react-query": "^5.20.1",
"@walletconnect/identity-keys": "^2.0.1",
"@walletconnect/notify-message-decrypter": "^0.1.0",
"@web3inbox/core": "^1.2.0-1b3d9b8",
"@web3inbox/core": "^1.2.0-7fe8f3d",
"@web3inbox/react": "^1.2.0-2fe9a9d",
"@web3modal/wagmi": "^4.0.13",
"classnames": "^2.3.2",
Expand Down
8 changes: 6 additions & 2 deletions src/utils/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LocalStorage } from '@/utils/localStorage'
import { notificationPwaModalService } from '@/utils/store'

import { getFirebaseToken } from './firebase'
import { getDbSymkeyStore } from './idb'
import { getDbEchoRegistrations, getDbSymkeyStore } from './idb'

const setupSubscriptionSymkey = async (topic: string, symkey: string) => {
const [, putSymkey] = await getDbSymkeyStore()
Expand Down Expand Up @@ -75,6 +75,10 @@ export const registerWithEcho = async (client: Web3InboxClient) => {
if (await requireNotifyPermission()) {
const token = await getFirebaseToken()

await client.registerWithPushServer(token, 'fcm')
const clientId = await client.registerWithPushServer(token, 'fcm')

const [, putRegistrationToken ] = await getDbEchoRegistrations()

await putRegistrationToken(clientId, token)
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3823,10 +3823,10 @@
"@walletconnect/window-getters" "^1.0.1"
tslib "1.14.1"

"@web3inbox/core@^1.2.0-1b3d9b8":
version "1.2.0-1b3d9b8"
resolved "https://registry.yarnpkg.com/@web3inbox/core/-/core-1.2.0-1b3d9b8.tgz#f46e15964e6ce39aab5b4f8a3a593b1ecb2da3cb"
integrity sha512-motTbWpXGOxAwcWss7vT3Xk5Z54UG9GFGcsMKSqc1kM/f27odEGhSaGcZcNXZCuyiXZaRfPEeItqOczO1tnhZQ==
"@web3inbox/core@^1.2.0-7fe8f3d":
version "1.2.0-7fe8f3d"
resolved "https://registry.yarnpkg.com/@web3inbox/core/-/core-1.2.0-7fe8f3d.tgz#056f8e7e21788ca0f7d397fa33f3360386073a72"
integrity sha512-mv/jwTnjehNq66fpuB1D8WbDYn+um0wl5drIn4wl7zfUgC9iLcH81l1CpiWR8V03cryp6g7ZZZm44A3LGllv4w==
dependencies:
"@walletconnect/core" "2.11.0"
"@walletconnect/notify-client" "^1.1.2"
Expand Down

0 comments on commit 32cafe7

Please sign in to comment.