Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/lib/openFolder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fsOperation from "fileSystem";

Check failure on line 1 in src/lib/openFolder.js

View workflow job for this annotation

GitHub Actions / Linting and formatting

format

File content differs from formatting output

Check failure on line 1 in src/lib/openFolder.js

View workflow job for this annotation

GitHub Actions / Linting and formatting

format

File content differs from formatting output
import sidebarApps from "sidebarApps";
import collapsableList from "components/collapsableList";
import FileTree from "components/fileTree";
Expand Down Expand Up @@ -624,6 +624,7 @@

toast(strings.success);
FileList.remove(url);
await removeEntryFromFileTree(url);
Comment thread
UnschooledGamer marked this conversation as resolved.
Outdated
}

async function renameFile() {
Expand Down Expand Up @@ -1055,6 +1056,24 @@
);
}

async function removeEntryFromFileTree(url){
const filesApp = sidebarApps.get("files");
const $els = filesApp.getAll(`[data-url="${folderUrl}"]`);
Comment thread
UnschooledGamer marked this conversation as resolved.
Outdated

await Promise.all(
Array.from($els).map(async ($el) => {
if (!(helpers.isDir($el.dataset.type) || $el.dataset.type === "root")) {
return;
}

const fileTree = getLoadedFileTree($el);
if (fileTree) {
await fileTree.removeEntity(url);
Comment thread
UnschooledGamer marked this conversation as resolved.
Outdated
}
}),
);
}

/**
* Create a folder tile
* @param {string} name
Expand Down
Loading