[go: nahoru, domu]

Skip to content

Commit

Permalink
Fix updateToken (#3312)
Browse files Browse the repository at this point in the history
* fix assignment order

* Create cuddly-rivers-add.md
  • Loading branch information
Feiyang1 committed Jun 27, 2020
1 parent 9e204e7 commit 17c628e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/cuddly-rivers-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@firebase/messaging": patch
"firebase": patch
---

Fixed an issue where we try to update token for every getToken() call because we don't save the updated token in the IndexedDB.
4 changes: 2 additions & 2 deletions packages/messaging/src/core/token-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ async function updateToken(
);

const updatedTokenDetails: TokenDetails = {
...tokenDetails,
token: updatedToken,
createTime: Date.now(),
...tokenDetails
createTime: Date.now()
};

await dbSet(firebaseDependencies, updatedTokenDetails);
Expand Down

0 comments on commit 17c628e

Please sign in to comment.