Skip to content

Commit 93a2048

Browse files
committed
Fixed buggy policy references in the Options dialog.
1 parent 35d82bd commit 93a2048

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/ui/options.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,17 @@
144144

145145
// SITES UI
146146
let sitesUI = new UI.Sites(document.getElementById("sites"));
147+
UI.onSettings = () => {
148+
policy = UI.policy;
149+
sitesUI.render(policy.sites);
150+
}
147151
{
148152
sitesUI.onChange = () => {
149153
if (UI.local.debug) {
150154
updateRawPolicyEditor();
151155
}
152156
};
153-
let sites = policy.sites;
154-
sitesUI.render(sites);
157+
sitesUI.render(policy.sites);
155158

156159
let newSiteForm = document.querySelector("#form-newsite");
157160
let newSiteInput = newSiteForm.newsite;
@@ -194,7 +197,7 @@
194197
if (!policyEditor.onchange) policyEditor.onchange = (e) => {
195198
let ed = e.currentTarget
196199
try {
197-
policy = new Policy(JSON.parse(ed.value));
200+
UI.policy = policy = new Policy(JSON.parse(ed.value));
198201
UI.updateSettings({policy});
199202
sitesUI.render(policy.sites);
200203
ed.className = "";

0 commit comments

Comments
 (0)