From 2a20d5bec4aa2c04204d4de77a50e69a97616fdf Mon Sep 17 00:00:00 2001 From: mitch Date: Wed, 23 Mar 2022 08:41:46 -0400 Subject: [PATCH] CT-30 BUG: clear button removes login token --- src/main/webapp/app/entities/army/army-detail.component.ts | 3 +-- src/main/webapp/app/entities/force/force.component.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/app/entities/army/army-detail.component.ts b/src/main/webapp/app/entities/army/army-detail.component.ts index 4f9c1e74..e6405016 100644 --- a/src/main/webapp/app/entities/army/army-detail.component.ts +++ b/src/main/webapp/app/entities/army/army-detail.component.ts @@ -18,7 +18,6 @@ export class ArmyDetailComponent implements OnInit { units: IArmy['units'] | null = null; private forcePoints: number; @LocalStorage('forceAddedListStored') - // @LocalStorage('ArmyStored') public forceUnitList: ForceUnit[]; private responsiveService: ResponsiveService = new ResponsiveService(); public isMobileResolution: boolean; @@ -132,8 +131,8 @@ export class ArmyDetailComponent implements OnInit { } clearForce(): void { - localStorage.clear(); this.forceUnitList = []; this.forcePoints = 0; + localStorage.setItem('forceAddedListStored', JSON.stringify(this.forceUnitList)); } } diff --git a/src/main/webapp/app/entities/force/force.component.ts b/src/main/webapp/app/entities/force/force.component.ts index bc16cd35..86e82540 100644 --- a/src/main/webapp/app/entities/force/force.component.ts +++ b/src/main/webapp/app/entities/force/force.component.ts @@ -96,8 +96,8 @@ export class ForceComponent implements OnInit { } clearList(): void { - localStorage.clear(); this.forceList = []; + localStorage.setItem('forceAddedListStored', JSON.stringify(this.forceList)); } byteSize(base64String: string): string { -- 2.45.2