diff --git a/frontend/src/store.js b/frontend/src/store.js index b047e16..6a13b68 100644 --- a/frontend/src/store.js +++ b/frontend/src/store.js @@ -52,6 +52,7 @@ export default createStore({ localStorage.setItem('remember', remember); }, setInventoryItems(state, {url, items}) { + console.log('setInventoryItems', url, items) state.item_map[url] = items; }, setFriends(state, friends) { @@ -109,13 +110,12 @@ export default createStore({ actions: { async login({commit, dispatch, state, getters}, {username, password, remember}) { commit('setRemember', remember); - const data = await dispatch('lookupServer', {username}).then(servers => new ServerSet(servers, state.unreachable_neighbors)) - .then(set => set.post(getters.nullAuth, '/auth/token/', {username, password})) + const s = await dispatch('lookupServer', {username}).then(servers => new ServerSet(servers, state.unreachable_neighbors)) + const data = await s.post(getters.nullAuth, '/auth/token/', {username, password}) if (data.token && data.key) { commit('setToken', data.token); commit('setUser', username); commit('setKey', data.key); - const s = await dispatch('lookupServer', {username}).then(servers => new ServerSet(servers, state.unreachable_neighbors)) commit('setHomeServers', s) return true; } else { diff --git a/frontend/src/views/Inventory.vue b/frontend/src/views/Inventory.vue index 8e51e75..82e6196 100644 --- a/frontend/src/views/Inventory.vue +++ b/frontend/src/views/Inventory.vue @@ -77,7 +77,7 @@