Skip to content

Commit

Permalink
Revert "fix(usebruno#251, usebruno#265): phantoms folders fix on rena…
Browse files Browse the repository at this point in the history
…me/delete needs to be run only on windows"

This reverts commit fcc12fb.
  • Loading branch information
Its-treason committed Oct 13, 2023
1 parent 102f7a5 commit 0a11a29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from 'utils/collections';
import { collectionSchema, itemSchema, environmentSchema, environmentsSchema } from '@usebruno/schema';
import { waitForNextTick } from 'utils/common';
import { getDirectoryName, isWindowsOS } from 'utils/common/platform';
import { getDirectoryName } from 'utils/common/platform';
import { sendNetworkRequest, cancelNetworkRequest } from 'utils/network';

import {
Expand Down Expand Up @@ -311,13 +311,7 @@ export const renameItem = (newName, itemUid, collectionUid) => (dispatch, getSta
ipcRenderer
.invoke('renderer:rename-item', item.pathname, newPathname, newName)
.then(() => {
// In case of Mac and Linux, we get the unlinkDir and addDir IPC events from electron which takes care of updating the state
// But in windows we don't get those events, so we need to update the state manually
// This looks like an issue in our watcher library chokidar
// GH: https://github.com/usebruno/bruno/issues/251
if (isWindowsOS()) {
dispatch(_renameItem({ newName, itemUid, collectionUid }));
}
dispatch(_renameItem({ newName, itemUid, collectionUid }));
resolve();
})
.catch(reject);
Expand Down Expand Up @@ -405,13 +399,7 @@ export const deleteItem = (itemUid, collectionUid) => (dispatch, getState) => {
ipcRenderer
.invoke('renderer:delete-item', item.pathname, item.type)
.then(() => {
// In case of Mac and Linux, we get the unlinkDir IPC event from electron which takes care of updating the state
// But in windows we don't get those events, so we need to update the state manually
// This looks like an issue in our watcher library chokidar
// GH: https://github.com/usebruno/bruno/issues/265
if (isWindowsOS()) {
dispatch(_deleteItem({ itemUid, collectionUid }));
}
dispatch(_deleteItem({ itemUid, collectionUid }));
resolve();
})
.catch((error) => reject(error));
Expand Down
1 change: 0 additions & 1 deletion packages/bruno-app/src/utils/common/platform.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import trim from 'lodash/trim';
import path from 'path';
import slash from './slash';
import platform from 'platform';

export const isElectron = () => {
if (!window) {
Expand Down

0 comments on commit 0a11a29

Please sign in to comment.