Use local buildFilePath

This commit is contained in:
Johannes Zellner
2023-09-20 10:04:24 +02:00
parent 585bd04c42
commit 51d49ef60a
2 changed files with 18 additions and 11 deletions
+8 -8
View File
@@ -131,7 +131,7 @@ import ProgressSpinner from 'primevue/progressspinner';
import { useConfirm } from 'primevue/useconfirm';
import { DirectoryView, TopBar, PathBreadcrumbs, BottomBar, MainLayout, FileUploader } from 'pankow';
import { sanitize, buildFilePath, sleep } from 'pankow/utils';
import { sanitize, sleep } from 'pankow/utils';
import { ISTATES } from '../constants.js';
@@ -256,7 +256,7 @@ export default {
},
async onNewFileDialogSubmit() {
this.newFileDialog.busy = true;
await this.directoryModel.newFile(buildFilePath(this.cwd, this.newFileDialog.name), this.newFileDialog.name);
await this.directoryModel.newFile(this.directoryModel.buildFilePath(this.cwd, this.newFileDialog.name), this.newFileDialog.name);
await this.loadCwd();
this.newFileDialog.visible = false;
},
@@ -267,7 +267,7 @@ export default {
},
async onNewFolderDialogSubmit() {
this.newFolderDialog.busy = true;
await this.directoryModel.newFolder(buildFilePath(this.cwd, this.newFolderDialog.name));
await this.directoryModel.newFolder(this.directoryModel.buildFilePath(this.cwd, this.newFolderDialog.name));
await this.loadCwd();
this.newFolderDialog.visible = false;
},
@@ -360,7 +360,7 @@ export default {
for (let i in files) {
try {
await this.directoryModel.remove(buildFilePath(this.cwd, files[i].name));
await this.directoryModel.remove(this.directoryModel.buildFilePath(this.cwd, files[i].name));
} catch (e) {
console.error(`Failed to remove file ${files[i].name}:`, e);
}
@@ -372,14 +372,14 @@ export default {
this.deleteInProgress = false;
},
async renameHandler(file, newName) {
await this.directoryModel.rename(buildFilePath(this.cwd, file.name), sanitize(this.cwd + '/' + newName));
await this.directoryModel.rename(this.directoryModel.buildFilePath(this.cwd, file.name), sanitize(this.cwd + '/' + newName));
await this.loadCwd();
},
async changeOwnerHandler(files, newOwnerUid) {
if (!files) return;
for (let i in files) {
await this.directoryModel.chown(buildFilePath(this.cwd, files[i].name), newOwnerUid);
await this.directoryModel.chown(this.directoryModel.buildFilePath(this.cwd, files[i].name), newOwnerUid);
}
await this.loadCwd();
@@ -416,11 +416,11 @@ export default {
this.pasteInProgress = false;
},
async downloadHandler(file) {
await this.directoryModel.download(buildFilePath(this.cwd, file.name));
await this.directoryModel.download(this.directoryModel.buildFilePath(this.cwd, file.name));
},
async extractHandler(file) {
this.extractInProgress = true;
await this.directoryModel.extract(buildFilePath(this.cwd, file.name));
await this.directoryModel.extract(this.directoryModel.buildFilePath(this.cwd, file.name));
await this.loadCwd();
this.extractInProgress = false;
},