@@ -171,11 +171,7 @@ export const cancelRequest = (cancelTokenUid, item, collection) => (dispatch) =>
171
171
. catch ( ( err ) => console . log ( err ) ) ;
172
172
} ;
173
173
174
- // todo: this can be directly put inside the collections/index.js file
175
- // the coding convention is to put only actions that need ipc in this file
176
- export const sortCollections = ( order ) => ( dispatch ) => {
177
- dispatch ( _sortCollections ( order ) ) ;
178
- } ;
174
+
179
175
export const runCollectionFolder = ( collectionUid , folderUid , recursive ) => ( dispatch , getState ) => {
180
176
const state = getState ( ) ;
181
177
const collection = findCollectionByUid ( state . collections . collections , collectionUid ) ;
@@ -293,19 +289,10 @@ export const renameItem = (newName, itemUid, collectionUid) => (dispatch, getSta
293
289
}
294
290
const { ipcRenderer } = window ;
295
291
296
- ipcRenderer
297
- . invoke ( 'renderer:rename-item' , item . pathname , newPathname , newName )
298
- . then ( ( ) => {
299
- // In case of Mac and Linux, we get the unlinkDir and addDir IPC events from electron which takes care of updating the state
300
- // But in windows we don't get those events, so we need to update the state manually
301
- // This looks like an issue in our watcher library chokidar
302
- // GH: https://github.com/usebruno/bruno/issues/251
303
- if ( isWindowsOS ( ) ) {
304
- dispatch ( _renameItem ( { newName, itemUid, collectionUid } ) ) ;
305
- }
306
- resolve ( ) ;
307
- } )
308
- . catch ( reject ) ;
292
+ ipcRenderer . invoke ( 'renderer:rename-item' , item . pathname , newPathname , newName ) . then ( ( ) => {
293
+ dispatch ( _renameItem ( { newName, itemUid, collectionUid } ) )
294
+ resolve ( )
295
+ } ) . catch ( reject ) ;
309
296
} ) ;
310
297
} ;
311
298
@@ -390,21 +377,18 @@ export const deleteItem = (itemUid, collectionUid) => (dispatch, getState) => {
390
377
ipcRenderer
391
378
. invoke ( 'renderer:delete-item' , item . pathname , item . type )
392
379
. then ( ( ) => {
393
- // In case of Mac and Linux, we get the unlinkDir IPC event from electron which takes care of updating the state
394
- // But in windows we don't get those events, so we need to update the state manually
395
- // This looks like an issue in our watcher library chokidar
396
- // GH: https://github.com/usebruno/bruno/issues/265
397
- if ( isWindowsOS ( ) ) {
398
- dispatch ( _deleteItem ( { itemUid, collectionUid } ) ) ;
399
- }
400
- resolve ( ) ;
380
+ dispatch ( _deleteItem ( { itemUid, collectionUid } ) )
381
+ resolve ( )
401
382
} )
402
383
. catch ( ( error ) => reject ( error ) ) ;
403
384
}
404
385
return ;
405
386
} ) ;
406
387
} ;
407
388
389
+ export const sortCollections = ( ) => ( dispatch ) => {
390
+ dispatch ( _sortCollections ( ) )
391
+ }
408
392
export const moveItem = ( collectionUid , draggedItemUid , targetItemUid ) => ( dispatch , getState ) => {
409
393
const state = getState ( ) ;
410
394
const collection = findCollectionByUid ( state . collections . collections , collectionUid ) ;
0 commit comments