Removed deprecated functions in virtual drive

This commit is contained in:
Prozilla 2023-08-08 20:09:31 +02:00
parent f3938e5aa5
commit ea2c558c51
No known key found for this signature in database
GPG key ID: 5858DFE71CAF31EE
3 changed files with 1 additions and 49 deletions

View file

@ -53,7 +53,6 @@ export function SearchMenu({ active, setActive, searchQuery, setSearchQuery, inp
value={searchQuery}
onChange={onChange}
spellCheck={false}
autoFocus
/>
<div className={appStyles["App-list"]}>
{apps?.map(({ name, id }) =>

View file

@ -159,53 +159,6 @@ export class VirtualFolder extends VirtualBase {
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
* @param {VirtualFile|VirtualFolder} child

View file

@ -91,7 +91,7 @@ export class VirtualRoot extends VirtualFolder {
}
loadData() {
let data = StorageManager.load("data");
const data = StorageManager.load("data");
if (data == null)
return;