Skip to content

Commit 7808a6d

Browse files
committed
Revert "fix(usebruno#251, usebruno#265): phantoms folders fix on rename/delete needs to be run only on windows"
This reverts commit fcc12fb. # Conflicts: # packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js # packages/bruno-app/src/utils/common/platform.js
1 parent b07ccbd commit 7808a6d

File tree

2 files changed

+10
-27
lines changed

2 files changed

+10
-27
lines changed

Diff for: packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js

+10-26
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,7 @@ export const cancelRequest = (cancelTokenUid, item, collection) => (dispatch) =>
171171
.catch((err) => console.log(err));
172172
};
173173

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+
179175
export const runCollectionFolder = (collectionUid, folderUid, recursive) => (dispatch, getState) => {
180176
const state = getState();
181177
const collection = findCollectionByUid(state.collections.collections, collectionUid);
@@ -293,19 +289,10 @@ export const renameItem = (newName, itemUid, collectionUid) => (dispatch, getSta
293289
}
294290
const { ipcRenderer } = window;
295291

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);
309296
});
310297
};
311298

@@ -390,21 +377,18 @@ export const deleteItem = (itemUid, collectionUid) => (dispatch, getState) => {
390377
ipcRenderer
391378
.invoke('renderer:delete-item', item.pathname, item.type)
392379
.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()
401382
})
402383
.catch((error) => reject(error));
403384
}
404385
return;
405386
});
406387
};
407388

389+
export const sortCollections = () => (dispatch) => {
390+
dispatch(_sortCollections())
391+
}
408392
export const moveItem = (collectionUid, draggedItemUid, targetItemUid) => (dispatch, getState) => {
409393
const state = getState();
410394
const collection = findCollectionByUid(state.collections.collections, collectionUid);

Diff for: packages/bruno-app/src/utils/common/platform.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import trim from 'lodash/trim';
22
import path from 'path';
33
import slash from './slash';
4-
import platform from 'platform';
54

65
export const isElectron = () => {
76
if (!window) {

0 commit comments

Comments
 (0)