MCPcopy Index your code
hub / github.com/reactide/reactide / fileTreeInit

Method fileTreeInit

renderer/components/App.jsx:179–201  ·  view source on GitHub ↗

* Registers listeners for opening projects and new projects

()

Source from the content-addressed store, hash-verified

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

Callers 1

constructorMethod · 0.95

Calls 2

setFileTreeMethod · 0.95
closeMethod · 0.80

Tested by

no test coverage detected