Skip to content

Commit 43ce65a

Browse files
authored
Merge pull request #366 from Kaushik-Kumar-CEG/fix/datasync-auth-condition-logic
fix(data-sync): correct always-true auth condition in workarea
2 parents 21d400d + 67f0398 commit 43ce65a

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/app/app-modules/data-sync/workarea/workarea.component.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ export class WorkareaComponent
6666

6767
ngOnInit() {
6868
this.assignSelectedLanguage();
69-
if (
70-
this.sessionstorage.getItem('serverKey') !== null ||
71-
this.sessionstorage.getItem('serverKey') !== undefined
72-
) {
69+
const serverKey = this.sessionstorage.getItem('serverKey');
70+
if (serverKey) {
7371
this.getDataSYNCGroup();
7472
} else {
7573
this.router.navigate(['datasync/sync-login']);
@@ -348,8 +346,7 @@ export class WorkareaComponent
348346
this.dataSyncService
349347
.inventorySyncDownloadData(vanID)
350348
.subscribe((res: any) => {
351-
if (res.statusCode === 200) {
352-
} else {
349+
if (res.statusCode !== 200) {
353350
this.confirmationService.alert(res.errorMessage, 'error');
354351
}
355352
});

0 commit comments

Comments
 (0)