More lenient filter to add a new entry to per-site permissions.

This commit is contained in:
hackademix 2021-01-13 23:50:55 +01:00
parent 04fad994f4
commit 09a6593011
1 changed files with 4 additions and 1 deletions

View File

@ -163,7 +163,10 @@
let newSiteForm = document.querySelector("#form-newsite");
let newSiteInput = newSiteForm.newsite;
let button = newSiteForm.querySelector("button");
let canAdd = s => policy.get(s).siteMatch === null;
let canAdd = s => {
let match = policy.get(s).siteMatch;
return match === null || s.length > match.length;
}
let validate = () => {
let site = newSiteInput.value.trim();