From 4a9f7ef6e57a2c8e8c822e844a465209d9ce9b1b Mon Sep 17 00:00:00 2001 From: Vailorium Date: Thu, 28 Jan 2021 20:14:21 +1300 Subject: [PATCH] localStorage fix --- dist/main-es2015.js | 3 +++ dist/main-es5.js | 8 ++++++++ src/app/pages/ar-builder/ar-builder.component.ts | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/dist/main-es2015.js b/dist/main-es2015.js index 31929e8..ea97ee5 100644 --- a/dist/main-es2015.js +++ b/dist/main-es2015.js @@ -1712,6 +1712,9 @@ class ArBuilderComponent { catch (e) { this.settings = { grid: true, movement: true, weapon: true }; } + if (localStorage.getItem('ar-settings') === null) { + this.settings = { grid: true, movement: true, weapon: true }; + } if (!this.settings.grid) { this.settings = { grid: true, movement: true, weapon: true }; } diff --git a/dist/main-es5.js b/dist/main-es5.js index 3ae182e..06bc105 100644 --- a/dist/main-es5.js +++ b/dist/main-es5.js @@ -3980,6 +3980,14 @@ }; } + if (localStorage.getItem('ar-settings') === null) { + this.settings = { + grid: true, + movement: true, + weapon: true + }; + } + if (!this.settings.grid) { this.settings = { grid: true, diff --git a/src/app/pages/ar-builder/ar-builder.component.ts b/src/app/pages/ar-builder/ar-builder.component.ts index 90aa8db..dcea0b8 100644 --- a/src/app/pages/ar-builder/ar-builder.component.ts +++ b/src/app/pages/ar-builder/ar-builder.component.ts @@ -150,6 +150,10 @@ export class ArBuilderComponent implements OnInit, AfterViewInit { this.settings = {grid: true, movement: true, weapon: true}; } + if(localStorage.getItem('ar-settings') === null){ + this.settings = {grid: true, movement: true, weapon: true}; + } + if(!this.settings.grid){ this.settings = {grid: true, movement: true, weapon: true}; } @@ -163,6 +167,7 @@ export class ArBuilderComponent implements OnInit, AfterViewInit { if(this.settings.weapon === undefined){ this.settings.weapon = true; } + this.season.valueChanges.subscribe((data) => { for(let i = 0; i < this.units.length; i++){ if(!this.units[i].blessing){