Skip to content

Commit

Permalink
fix: check for root available before listing files (#728)
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <[email protected]>
  • Loading branch information
pedrolamas authored Jun 23, 2022
1 parent 7b3bcd0 commit f67a178
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/store/history/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ export const actions: ActionTree<HistoryState, RootState> = {
/**
* Update the store with history
*/
async onHistoryList ({ commit }, payload) {
async onHistoryList ({ commit, rootGetters }, payload) {
if (payload) {
commit('setHistoryList', payload)
SocketActions.serverFilesGetDirectory('gcodes', 'gcodes')

if (rootGetters['files/isRootAvailable']('gcodes')) {
SocketActions.serverFilesGetDirectory('gcodes', 'gcodes')
}
}
},

Expand Down

0 comments on commit f67a178

Please sign in to comment.