fix: admin/config: localhost_admin validator could be triggered by a failed request

Massimo Melina committed Apr 25, 2022 at 18:51 UTC 1f2b1257b0642e1cfafea62e43a64fcfc42567a1
1 file changed +1 -1
admin/src/ConfigPage.ts
+1 -1
@@ -87,7 +87,7 @@ export default function ConfigPage() {
87 values.https_port >= 0 && { k: 'private_key', comp: FileField, label: "HTTPS private key file" },
88 { k: 'open_browser_at_start', comp: BoolField },
89 { k: 'localhost_admin', comp: BoolField, label: "Admin access for localhost connections",
90 - validate: x => x || admins?.length>0 || "First create at least one admin account",
90 + validate: x => x || !admins || admins.length>0 || "First create at least one admin account",
91 helperText: "To access Admin without entering credentials"
92 },
93 ...Object.entries(logLabels).map(a => ({ k: a[0], label: a[1], lg: 3 })),