Skip to content

Commit 1705511

Browse files
committed
fix init bug
1 parent e17fa6d commit 1705511

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

browser/main/modals/InitModal.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dataApi from 'browser/main/lib/dataApi'
55
import store from 'browser/main/store'
66
import { hashHistory } from 'react-router'
77
import _ from 'lodash'
8+
import keygen from 'browser/lib/keygen'
89

910
const CSON = require('season')
1011
const path = require('path')
@@ -101,6 +102,24 @@ class InitModal extends React.Component {
101102
return data
102103
})
103104
.then((data) => {
105+
if (data.storage.folders[0] != null) {
106+
return data
107+
} else {
108+
return dataApi
109+
.createFolder(data.storage.key, {
110+
color: '#6AA5E9',
111+
name: 'Default'
112+
})
113+
.then((_data) => {
114+
return {
115+
storage: _data.storage,
116+
notes: data.notes
117+
}
118+
})
119+
}
120+
})
121+
.then((data) => {
122+
console.log(data)
104123
store.dispatch({
105124
type: 'ADD_STORAGE',
106125
storage: data.storage,

0 commit comments

Comments
 (0)