Don't Ping if we're not logged in

This commit is contained in:
Matthias 2020-09-20 15:59:35 +02:00
parent dc2f7034e4
commit a6d4de0c66

View File

@ -83,14 +83,16 @@ export default {
},
},
actions: {
ping({ commit }) {
api
.get('/ping')
.then((result) => {
commit('setPing', result.data, { root: true });
commit('setIsBotOnline', result.data, { root: true });
})
.catch(console.error);
ping({ commit, rootState }) {
if (rootState.loggedIn) {
api
.get('/ping')
.then((result) => {
commit('setPing', result.data, { root: true });
commit('setIsBotOnline', result.data, { root: true });
})
.catch(console.error);
}
},
setDetailTrade({ commit }, trade: Trade) {
commit('setDetailTrade', trade);