Skip to content

Commit

Permalink
[TAS-948] 🚸 Use localStorage instead of sessionStorage to allow sessi…
Browse files Browse the repository at this point in the history
…on across new tabs
  • Loading branch information
williamchong committed Jan 3, 2024
1 parent ef35105 commit 8c8267c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/WalletHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ const portfolioURL = computed(() => getPortfolioURL(wallet.value))
function onClickDisconnect () {
disconnect()
window.sessionStorage.removeItem('likecoin_nft_book_press_token')
window.localStorage.removeItem('likecoin_nft_book_press_token')
}
</script>
4 changes: 2 additions & 2 deletions pages/nft-book-store.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ watch(isLoading, (newIsLoading) => {
onMounted(async () => {
try {
const payload = window.sessionStorage.getItem('likecoin_nft_book_press_token')
const payload = window.localStorage.getItem('likecoin_nft_book_press_token')
if (payload) {
const { wallet: storedWallet, token } = JSON.parse(payload)
restoreSession(storedWallet, token)
Expand All @@ -71,7 +71,7 @@ async function onClickAuth () {
const signature = await signMessageMemo('authorize', ['read:nftbook', 'write:nftbook'])
await authenticate(wallet.value, signature)
try {
window.sessionStorage.setItem('likecoin_nft_book_press_token', JSON.stringify({ wallet: sessionWallet.value, token: token.value }))
window.localStorage.setItem('likecoin_nft_book_press_token', JSON.stringify({ wallet: sessionWallet.value, token: token.value }))
} catch (err) {}
} catch (err) {
console.error(err)
Expand Down

0 comments on commit 8c8267c

Please sign in to comment.