Skip to content

Commit ac99633

Browse files
authored
Merge pull request #65 from rubberduck-vba/webhook
fix storage enabled toggle
2 parents 544f39f + a489544 commit ac99633

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

rubberduckvba.client/src/app/routes/indenter/indenter.component.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,12 @@ export class IndenterComponent implements OnInit, IndenterOptionGroups {
3838
const localOptionGroups = localStorage.getItem('indenter.options');
3939
this.isLocalStorageOK = localModel != null || localOptionGroups != null;
4040

41-
if (!this.isLocalStorageOK) {
42-
this.getDefaults();
43-
return;
44-
}
45-
4641
if (localModel) {
4742
this.model = <IndenterViewModel>JSON.parse(localModel);
4843
}
44+
else {
45+
this.getDefaults();
46+
}
4947

5048
if (localOptionGroups) {
5149
const optionGroups = <IndenterOptionGroups>JSON.parse(localOptionGroups);
@@ -89,6 +87,10 @@ export class IndenterComponent implements OnInit, IndenterOptionGroups {
8987
if (!value) {
9088
this.clearStorage();
9189
}
90+
else {
91+
this.saveModel();
92+
this.saveOptions();
93+
}
9294
}
9395

9496
public get model(): IndenterViewModel {

0 commit comments

Comments
 (0)