@@ -38,12 +38,20 @@ export default class ImportProfileModal extends mixins(ProfilesMixin) {
38
38
private importUpdateSelection: " IMPORT" | " UPDATE" | null = null ;
39
39
private percentageImported: number = 0 ;
40
40
private profileImportCode: string = ' ' ;
41
- private isProfileBeingImported: boolean = false ;
42
41
private listenerId: number = 0 ;
43
42
private newProfileName: string = ' ' ;
44
43
private profileImportFilePath: string | null = null ;
45
44
private profileImportContent: ExportFormat | null = null ;
46
- private activeStep: ' IMPORT_UPDATE_SELECTION' | ' FILE_CODE_SELECTION' | ' IMPORT_CODE' | ' IMPORT_FILE' | ' ADDING_PROFILE' | ' REVIEW_IMPORT' | ' NO_PACKAGES_IN_IMPORT' = ' IMPORT_UPDATE_SELECTION' ;
45
+ private activeStep:
46
+ ' IMPORT_UPDATE_SELECTION'
47
+ | ' FILE_CODE_SELECTION'
48
+ | ' IMPORT_CODE'
49
+ | ' IMPORT_FILE'
50
+ | ' ADDING_PROFILE'
51
+ | ' REVIEW_IMPORT'
52
+ | ' NO_PACKAGES_IN_IMPORT'
53
+ | ' PROFILE_IS_BEING_IMPORTED'
54
+ = ' IMPORT_UPDATE_SELECTION' ;
47
55
48
56
async created() {
49
57
fs = FsProvider .instance ;
@@ -120,7 +128,7 @@ export default class ImportProfileModal extends mixins(ProfilesMixin) {
120
128
121
129
async importProfileHandler(files : string [] | null ) {
122
130
if (files === null || files .length === 0 ) {
123
- this .isProfileBeingImported = false ;
131
+ this .closeModal () ;
124
132
return ;
125
133
}
126
134
@@ -203,7 +211,7 @@ export default class ImportProfileModal extends mixins(ProfilesMixin) {
203
211
await this .$store .dispatch (' profiles/setSelectedProfile' , { profileName: profileName , prewarmCache: true });
204
212
}
205
213
if (parsed .getMods ().length > 0 ) {
206
- this .isProfileBeingImported = true ;
214
+ this .activeStep = ' PROFILE_IS_BEING_IMPORTED ' ;
207
215
setTimeout (async () => {
208
216
await this .downloadImportedProfileMods (parsed .getMods (), async () => {
209
217
if (files [0 ].endsWith (' .r2z' )) {
@@ -253,7 +261,6 @@ export default class ImportProfileModal extends mixins(ProfilesMixin) {
253
261
downloadProgressCallback(progress : number , modName : string , status : number , err : R2Error | null ) {
254
262
if (status == StatusEnum .FAILURE ) {
255
263
this .closeModal ();
256
- this .isProfileBeingImported = false ;
257
264
if (err instanceof R2Error ) {
258
265
this .$store .commit (' error/handleError' , err );
259
266
}
@@ -273,7 +280,6 @@ export default class ImportProfileModal extends mixins(ProfilesMixin) {
273
280
if (installResult instanceof R2Error ) {
274
281
this .$store .commit (' error/handleError' , installResult );
275
282
keepIterating = false ;
276
- this .isProfileBeingImported = false ;
277
283
return ;
278
284
}
279
285
for (const imported of modList ) {
@@ -290,7 +296,7 @@ export default class ImportProfileModal extends mixins(ProfilesMixin) {
290
296
if (callback !== undefined ) {
291
297
callback ();
292
298
}
293
- this .isProfileBeingImported = false ;
299
+ this .closeModal () ;
294
300
}
295
301
296
302
// Called when the name for the imported profile is given and confirmed by the user.
@@ -421,11 +427,11 @@ export default class ImportProfileModal extends mixins(ProfilesMixin) {
421
427
</template >
422
428
</ModalCard >
423
429
424
- <ModalCard v-else-if =" isProfileBeingImported " key =" PROFILE_IS_BEING_IMPORTED" :is-active =" isOpen" :canClose =" false" >
430
+ <ModalCard v-else-if =" activeStep === 'PROFILE_IS_BEING_IMPORTED' " key =" PROFILE_IS_BEING_IMPORTED" :is-active =" isOpen" :canClose =" false" >
425
431
<template v-slot :header >
426
432
<h2 class =" modal-title" >{{percentageImported}}% imported</h2 >
427
433
</template >
428
- <template v-slot :body >
434
+ <template v-slot :footer >
429
435
<p >This may take a while, as mods are being downloaded.</p >
430
436
<p >Please do not close {{appName}}.</p >
431
437
</template >
0 commit comments