fixed uploading files and setting backup locations

This commit is contained in:
Shane Harris
2020-10-19 08:55:44 +01:00
parent ffcc256a14
commit 2ed693d245
4 changed files with 34 additions and 48 deletions
+10 -16
View File
@@ -56,7 +56,7 @@ export class FilesComponent implements OnInit {
} }
async makeFolder() { async makeFolder() {
if ( if (
~this.files !!~this.files
.filter(f => f.icon === 'folder') .filter(f => f.icon === 'folder')
.map(f => f.name) .map(f => f.name)
.indexOf(this.folderName) .indexOf(this.folderName)
@@ -173,14 +173,12 @@ export class FilesComponent implements OnInit {
}); });
} }
} }
uploadFiles() { async uploadFiles() {
this.appService.electron.remote.dialog.showOpenDialog( let res = await this.appService.electron.remote.dialog.showOpenDialog({
{
properties: ['openFile', 'multiSelections'], properties: ['openFile', 'multiSelections'],
defaultPath: this.adbService.savePath, defaultPath: this.adbService.savePath,
}, });
files => this.uploadFilesFromList(files) this.uploadFilesFromList(res.filePaths);
);
} }
quickSaveSupported() { quickSaveSupported() {
return this.quickSaveModels.includes(this.adbService.deviceModel); return this.quickSaveModels.includes(this.adbService.deviceModel);
@@ -268,20 +266,16 @@ export class FilesComponent implements OnInit {
.then(() => this.statusService.showStatus('Folder Saved OK!')); .then(() => this.statusService.showStatus('Folder Saved OK!'));
}); });
} }
pickLocation() { async pickLocation() {
this.appService.electron.remote.dialog.showOpenDialog( let res = await this.appService.electron.remote.dialog.showOpenDialog({
{
properties: ['openDirectory'], properties: ['openDirectory'],
defaultPath: this.adbService.savePath, defaultPath: this.adbService.savePath,
}, });
files => { if (res && res.filePaths && res.filePaths.length === 1) {
if (files !== undefined && files.length === 1) { this.adbService.savePath = res.filePaths[0];
this.adbService.savePath = files[0];
this.adbService.setSavePath(); this.adbService.setSavePath();
} }
} }
);
}
isConnected() { isConnected() {
const isConnected = this.adbService.deviceStatus === ConnectionStatus.CONNECTED; const isConnected = this.adbService.deviceStatus === ConnectionStatus.CONNECTED;
if (isConnected && !this.isOpen) { if (isConnected && !this.isOpen) {
@@ -209,19 +209,15 @@ export class HeaderComponent implements OnInit {
cancelLogcatOutput() { cancelLogcatOutput() {
this.saveLogcatPath = null; this.saveLogcatPath = null;
} }
selectLogcatOutput() { async selectLogcatOutput() {
this.appService.electron.remote.dialog.showOpenDialog( const res = await this.appService.electron.remote.dialog.showOpenDialog({
{
properties: ['openDirectory'], properties: ['openDirectory'],
defaultPath: this.adbService.savePath, defaultPath: this.adbService.savePath,
}, });
files => { res.filePaths.forEach(filepath => {
files.forEach(filepath => {
this.saveLogcatPath = filepath; this.saveLogcatPath = filepath;
}); });
} }
);
}
clearLogcatFile() { clearLogcatFile() {
if (this.saveLogcatPath) { if (this.saveLogcatPath) {
if (this.appService.fs.existsSync(this.saveLogcatPath)) { if (this.appService.fs.existsSync(this.saveLogcatPath)) {
@@ -79,20 +79,16 @@ export class PackagesComponent implements OnInit {
this.adbService.setPermission(this.currentPackage.package.packageName, perm.permission, !perm.enabled); this.adbService.setPermission(this.currentPackage.package.packageName, perm.permission, !perm.enabled);
} }
pickBackupLocation() { async pickBackupLocation() {
this.appService.electron.remote.dialog.showOpenDialog( const res = await this.appService.electron.remote.dialog.showOpenDialog({
{
properties: ['openDirectory'], properties: ['openDirectory'],
defaultPath: this.appService.backupPath, defaultPath: this.appService.backupPath,
}, });
files => { if (res && res.filePaths && res.filePaths.length === 1) {
if (files !== undefined && files.length === 1) { this.appService.backupPath = res.filePaths[0];
this.appService.backupPath = files[0];
localStorage.setItem('backup-path', this.appService.backupPath); localStorage.setItem('backup-path', this.appService.backupPath);
} }
} }
);
}
backupAll() { backupAll() {
this.myApps this.myApps
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "SideQuest", "name": "SideQuest",
"productName": "SideQuest", "productName": "SideQuest",
"version": "0.10.16", "version": "0.10.17",
"description": "A open app store for mobile android based VR devices such as the Levovo Mirage, Oculus Go, Oculus Quest, Vive Focus.", "description": "A open app store for mobile android based VR devices such as the Levovo Mirage, Oculus Go, Oculus Quest, Vive Focus.",
"repository": "https://github.com/SideQuestVR/SideQuest.git", "repository": "https://github.com/SideQuestVR/SideQuest.git",
"license": "UNLICENCED", "license": "UNLICENCED",