fixed a bug on extract of zip file

This commit is contained in:
Shane Harris
2022-08-02 21:02:51 +01:00
parent ba0fc5d54b
commit 3f1dfa3609
5 changed files with 10 additions and 10 deletions
+7 -6
View File
@@ -652,7 +652,6 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u
if (er.includes('SAFESIDE')) {
this.appService.headerComponent.safeModal.openModal();
}
console.log('app failed', er);
task.status =
(task.app_name ? task.app_name + ': ' : '') +
(e.message ? e.message : e.code ? e.code : e.reason ? e.reason : e.toString());
@@ -1036,7 +1035,7 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u
async installLocalZip(filepath, dontCatchError, cb, task?, deleteAfter?) {
const typeBasedActions = {
'.apk': filepath => {
this.installAPK(filepath, true, false, 0, 0, deleteAfter, this.appService.path.basename(filepath));
this.installAPK(filepath, true, false, 0, 0, deleteAfter, this.appService.path.basename(filepath) + ': ');
},
'.obb': filepath => {
if (this.appService.path.basename(filepath).match(this.obbRegex)) {
@@ -1061,10 +1060,6 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u
{ dir: this.appService.path.join(this.appService.appData, 'tmp') },
extractErr => {
if (!extractErr) {
if (task) {
task.status = 'Extracted Zip!';
}
resolve();
this.appService.fs.readdir(this.appService.path.join(this.appService.appData, 'tmp'), (readErr, files) => {
let installableFiles = files.filter((val, index) => {
return Object.keys(typeBasedActions).includes(this.appService.path.extname(val));
@@ -1078,6 +1073,12 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u
this
);
});
if (task) {
task.status = installableFiles.length ? 'Extracted Zip!' : 'No installable files in this zip...';
task.failed = !installableFiles.length;
}
resolve();
});
} else {
console.warn(extractErr);
@@ -1,3 +1,4 @@
.menu-chip{
max-width: 100%;
margin-bottom: 8px;
}
@@ -276,7 +276,7 @@
Thank you and have a great day!
</mz-modal-content>
<mz-modal-footer>
<div class="pure-material-button-contained" (click)="safeModal.closeModal(); ">Back to Safety</div>
<div class="pure-material-button-contained spaced" (click)="safeModal.closeModal(); ">Back to Safety</div>
</mz-modal-footer>
</mz-modal>
@@ -113,9 +113,7 @@ export class ProcessBucketService {
this.currentTask = null;
this.statusService.showStatus(task.status, true);
if (!task.cancelled) {
console.log('h1');
return timeout().then(async () => {
console.log('h2');
await this.processBucket();
});
}
+1 -1
View File
@@ -204,7 +204,7 @@ body{
.chip>i {
float: left;
margin: 0 8px 0 -8px;
margin: 0 8px 0 0px;
font-size: 28px;
line-height: 32px;
border-radius: 50%;