fix: admin/internet: domain not refreshed upon changing
Massimo Melina committed
Nov 11, 2023 at 17:33 UTC
d55e896f54c11ce4d465085a566511fec32b3ed9
1 file changed
+3
-3
admin/src/InternetPage.ts
+3
-3
@@ -21,7 +21,7 @@ export default function InternetPage() {
21
const [mapping, setMapping] = useState(false)
22
const [verifyAgain, setVerifyAgain] = useState(false)
23
const status = useApiEx('get_status')
24
- const { data: config } = useApiEx('get_config', { only: ['base_url'] })
24
+ const { data: config, reload: reloadConfig } = useApiEx('get_config', { only: ['base_url'] })
25
const localColor = with_([status.data?.http?.error, status.data?.https?.error], ([h, s]) =>
26
h && s ? 'error' : h || s ? 'warning' : 'success')
27
type GetNat = Awaited<ReturnType<typeof getNatInfo>>
@@ -108,13 +108,13 @@ export default function InternetPage() {
108
const url = config?.base_url
109
const hostname = url && new URL(url).hostname
110
const domain = !isIP(hostname) && hostname
111
- return status.element || h(Card, {}, h(CardContent, {},
111
+ return config && h(Card, {}, h(CardContent, {},
112
h(Box, { fontSize: 'x-large', mb: 2 }, "Address / Domain"),
113
h(Flex, { flexWrap: 'wrap', alignItems: 'center' },
114
url || "Automatic, not configured",
115
h(Button, {
116
size: 'small',
117
- onClick() { changeBaseUrl().then(status.reload) }
117
+ onClick() { changeBaseUrl().then(reloadConfig) }
118
}, "Change"),
119
domain && h(Btn, {
120
size: 'small',