Skip to content

Commit

Permalink
fix: load java correctly
Browse files Browse the repository at this point in the history
Former-commit-id: 78b0a87
  • Loading branch information
ci010 committed Jul 15, 2019
1 parent 015a9d6 commit 45f585f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/store/modules/java.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ const mod = {
actions: {
async load(context) {
const loaded = await context.dispatch('getPersistence', { path: 'java.json' });
if (loaded && loaded instanceof Array) {
context.commit('addJava', loaded.filter(l => typeof l.path === 'string'));
if (loaded && loaded.all instanceof Array) {
context.commit('addJava', loaded.all.filter(l => typeof l.path === 'string'));
}
if (context.state.all.length === 0) {
await context.dispatch('refreshLocalJava');
}
},
async init(context) {
Expand Down

0 comments on commit 45f585f

Please sign in to comment.