From a489544825cffda967c8f99aeaab344fbba01309 Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Tue, 11 Feb 2025 05:20:37 -0500 Subject: [PATCH] fix storage enabled toggle --- .../src/app/routes/indenter/indenter.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rubberduckvba.client/src/app/routes/indenter/indenter.component.ts b/rubberduckvba.client/src/app/routes/indenter/indenter.component.ts index d8764b9..97c3229 100644 --- a/rubberduckvba.client/src/app/routes/indenter/indenter.component.ts +++ b/rubberduckvba.client/src/app/routes/indenter/indenter.component.ts @@ -38,14 +38,12 @@ export class IndenterComponent implements OnInit, IndenterOptionGroups { const localOptionGroups = localStorage.getItem('indenter.options'); this.isLocalStorageOK = localModel != null || localOptionGroups != null; - if (!this.isLocalStorageOK) { - this.getDefaults(); - return; - } - if (localModel) { this.model = JSON.parse(localModel); } + else { + this.getDefaults(); + } if (localOptionGroups) { const optionGroups = JSON.parse(localOptionGroups); @@ -89,6 +87,10 @@ export class IndenterComponent implements OnInit, IndenterOptionGroups { if (!value) { this.clearStorage(); } + else { + this.saveModel(); + this.saveOptions(); + } } public get model(): IndenterViewModel {