File tree 3 files changed +11
-5
lines changed
dashboard/data-and-backup
3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,9 @@ export class CoreComponent implements OnInit {
143
143
if ( this . electronService . isElectron ) {
144
144
this . electronUpdateAvailableSub . unsubscribe ( ) ;
145
145
this . releaseDataSub . unsubscribe ( ) ;
146
- this . applicationInstanceDataSubscription . unsubscribe ( ) ;
146
+ if ( this . applicationInstanceDataSubscription ) {
147
+ this . applicationInstanceDataSubscription . unsubscribe ( ) ;
148
+ }
147
149
}
148
150
this . assessmentUpdateAvailableSub . unsubscribe ( ) ;
149
151
this . openingTutorialSub . unsubscribe ( ) ;
@@ -166,7 +168,7 @@ export class CoreComponent implements OnInit {
166
168
}
167
169
this . setAllDbData ( ) ;
168
170
} else {
169
- await this . coreService . setExistingApplicationInstanceData ( ) ;
171
+ await this . coreService . setApplicationInstanceData ( ) ;
170
172
this . setAllDbData ( ) ;
171
173
}
172
174
Original file line number Diff line number Diff line change @@ -79,9 +79,13 @@ export class CoreService {
79
79
this . applicationDataService . applicationInstanceData . next ( applicationInstanceData ) ;
80
80
}
81
81
82
- async setExistingApplicationInstanceData ( ) {
82
+ async setApplicationInstanceData ( ) {
83
83
let existingApplicationData : Array < ApplicationInstanceData > = await firstValueFrom ( this . applicationDataService . getApplicationInstanceData ( ) ) ;
84
- this . applicationDataService . applicationInstanceData . next ( existingApplicationData [ 0 ] ) ;
84
+ if ( existingApplicationData . length === 0 ) {
85
+ await this . setNewApplicationInstanceData ( ) ;
86
+ } else {
87
+ this . applicationDataService . applicationInstanceData . next ( existingApplicationData [ 0 ] ) ;
88
+ }
85
89
}
86
90
87
91
async createDefaultDirectories ( ) {
Original file line number Diff line number Diff line change 32
32
< div class ="card-header bold ">
33
33
Automatic Backup
34
34
</ div >
35
- < div *ngIf ="electronService.isElectron " class ="card-body ">
35
+ < div *ngIf ="electronService.isElectron && applicationInstanceData " class ="card-body ">
36
36
< div class ="d-flex w-100 alert feature-action ">
37
37
< div class ="d-flex flex-fill ">
38
38
< label >
You can’t perform that action at this time.
0 commit comments