Optimize quotes loading

This commit is contained in:
liangping
2021-10-07 21:25:33 +08:00
parent ffa366ee25
commit e34a82402f
14 changed files with 533 additions and 87 deletions
+11 -1
View File
@@ -48,6 +48,7 @@ export default {
avatars: {},
height: 0,
ibcChannels: {},
quotes: {},
},
getters: {
getchains: state => state.chains,
@@ -69,6 +70,15 @@ export default {
setChannels(state, { chain, channels }) {
state.chains.ibcChannels[chain] = channels
},
setQuotes(state, quotes) {
state.quotes = quotes
},
},
actions: {
async getQuotes(context) {
fetch('https://price.ping.pub/quotes').then(data => data.json()).then(data => {
context.commit('setQuotes', data)
})
},
},
actions: {},
}