* Registers listeners for opening projects and new projects
()
| 177 | */ |
| 178 | |
| 179 | fileTreeInit() { |
| 180 | ipcRenderer.on('openDir', (event, dirPath) => { |
| 181 | if (dirPath !== this.state.rootDirPath) { |
| 182 | this.setFileTree(dirPath); |
| 183 | } |
| 184 | }), |
| 185 | ipcRenderer.on('newProject', (event, arg) => { |
| 186 | if (this.state.watch) this.state.watch.close(); |
| 187 | console.log(this.state) |
| 188 | |
| 189 | this.setState({ |
| 190 | fileTree: null, |
| 191 | watch: null, |
| 192 | rootDirPath: '', |
| 193 | selectedItem: { |
| 194 | id: null, |
| 195 | path: null, |
| 196 | type: null |
| 197 | }, |
| 198 | cra: true, |
| 199 | }); |
| 200 | }) |
| 201 | } |
| 202 | /** |
| 203 | * sends old path and new name to main process to rename, closes rename form and sets filechangetype and newName for fswatch |
| 204 | * @param {Javascript event Object} event |
no test coverage detected