Removed deprecated functions in virtual drive
This commit is contained in:
parent
f3938e5aa5
commit
ea2c558c51
3 changed files with 1 additions and 49 deletions
|
|
@ -53,7 +53,6 @@ export function SearchMenu({ active, setActive, searchQuery, setSearchQuery, inp
|
||||||
value={searchQuery}
|
value={searchQuery}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
spellCheck={false}
|
spellCheck={false}
|
||||||
autoFocus
|
|
||||||
/>
|
/>
|
||||||
<div className={appStyles["App-list"]}>
|
<div className={appStyles["App-list"]}>
|
||||||
{apps?.map(({ name, id }) =>
|
{apps?.map(({ name, id }) =>
|
||||||
|
|
|
||||||
|
|
@ -159,53 +159,6 @@ export class VirtualFolder extends VirtualBase {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a file at a destination
|
|
||||||
* @deprecated
|
|
||||||
* @param {string} destination
|
|
||||||
*/
|
|
||||||
addFile(destination) {
|
|
||||||
const folderNames = destination.split("/");
|
|
||||||
const fileExtendedName = folderNames.pop().split();
|
|
||||||
const fileExtendedNameSegments = fileExtendedName.split(".");
|
|
||||||
|
|
||||||
const fileName = fileExtendedNameSegments[0];
|
|
||||||
const fileExtension = fileExtendedNameSegments.length > 1 ? fileExtendedNameSegments[1] : "txt";
|
|
||||||
|
|
||||||
// To do: check if file already exists
|
|
||||||
|
|
||||||
const file = new VirtualFile(fileName, fileExtension);
|
|
||||||
|
|
||||||
const folders = this.addFolder(folderNames.join("/"));
|
|
||||||
|
|
||||||
const parent = folders[folders.length - 1];
|
|
||||||
parent.files.push(file);
|
|
||||||
file.parent = parent;
|
|
||||||
|
|
||||||
this.getRoot().saveData();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a folder at a destination
|
|
||||||
* @deprecated
|
|
||||||
* @param {string} destination
|
|
||||||
*/
|
|
||||||
addFolder(destination) {
|
|
||||||
if (destination.endsWith("/"))
|
|
||||||
destination = destination.slice(0, -1);
|
|
||||||
|
|
||||||
const folderNames = destination.split("/");
|
|
||||||
|
|
||||||
let currentFolder = this;
|
|
||||||
folderNames.forEach((folderName) => {
|
|
||||||
if (!currentFolder.hasFolder(folderName)) {
|
|
||||||
currentFolder.createFolder(folderName);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.getRoot().saveData();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes a file or folder from this folder
|
* Removes a file or folder from this folder
|
||||||
* @param {VirtualFile|VirtualFolder} child
|
* @param {VirtualFile|VirtualFolder} child
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ export class VirtualRoot extends VirtualFolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
loadData() {
|
loadData() {
|
||||||
let data = StorageManager.load("data");
|
const data = StorageManager.load("data");
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue