Skip to content

Commit a489544

Browse files
committed
fix storage enabled toggle
1 parent 91db139 commit a489544

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

+7-5
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)