mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex-taker-v2.git
synced 2026-09-21 16:52:01 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0da9d4c567 | ||
|
|
3cf69cbd95 |
+4
-2
@@ -13,7 +13,8 @@ function useAppState () {
|
|||||||
ssr: true,
|
ssr: true,
|
||||||
defaultValue: {
|
defaultValue: {
|
||||||
serverUrl: 'https://free-bch.fullstack.cash' // Default server
|
serverUrl: 'https://free-bch.fullstack.cash' // Default server
|
||||||
}
|
},
|
||||||
|
nftData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('lsState: ', lsState)
|
console.log('lsState: ', lsState)
|
||||||
@@ -38,7 +39,7 @@ function useAppState () {
|
|||||||
const [denyClose, setDenyClose] = useState(false)
|
const [denyClose, setDenyClose] = useState(false)
|
||||||
|
|
||||||
// NFTs for sale stored data to improve performance
|
// NFTs for sale stored data to improve performance
|
||||||
const [nftForSaleCacheData, setNftForSaleCacheData] = useState({})
|
const [nftForSaleCacheData, setNftForSaleCacheData] = useState(lsState.nftData || {})
|
||||||
|
|
||||||
// The wallet state makes this a true progressive web app (PWA). As
|
// The wallet state makes this a true progressive web app (PWA). As
|
||||||
// balances, UTXOs, and tokens are retrieved, this state is updated.
|
// balances, UTXOs, and tokens are retrieved, this state is updated.
|
||||||
@@ -107,6 +108,7 @@ function useAppState () {
|
|||||||
const newCacheData = Object.assign({}, cacheData, data) // Merge the new data with the cache data
|
const newCacheData = Object.assign({}, cacheData, data) // Merge the new data with the cache data
|
||||||
allCacheData[tokenId] = newCacheData // Update the cache data
|
allCacheData[tokenId] = newCacheData // Update the cache data
|
||||||
setNftForSaleCacheData(allCacheData) // Update the state
|
setNftForSaleCacheData(allCacheData) // Update the state
|
||||||
|
updateLocalStorage({ nftData: allCacheData }) // Update the local storage
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user