diff --git a/src/pages/config.tsx b/src/pages/config.tsx index 69d0e6b2..081ffcca 100644 --- a/src/pages/config.tsx +++ b/src/pages/config.tsx @@ -7,7 +7,7 @@ import Input from '../components/textarea-input.jsx' import { ConfigContext, ConfigProvider } from '../context/config-context.jsx' import { RouteContext } from '../context/router-context.jsx' import { ServiceWorkerProvider } from '../context/service-worker-context.jsx' -import { getConfig, setConfig as storeConfig } from '../lib/config-db.js' +import { setConfig as storeConfig } from '../lib/config-db.js' import { convertDnsResolverInputToObject, convertDnsResolverObjectToInput, convertUrlArrayToInput, convertUrlInputToArray } from '../lib/input-helpers.js' import { isConfigPage } from '../lib/is-config-page.js' import { getUiComponentLogger, uiLogger } from '../lib/logger.js' @@ -82,7 +82,7 @@ export interface ConfigPageProps extends React.HTMLProps { // Config Page can be loaded either as a page or as a component in the landing helper-ui page const ConfigPage: FunctionComponent = () => { const { gotoPage } = useContext(RouteContext) - const { isLoading, setConfig, resetConfig, gateways, routers, dnsJsonResolvers, debug, enableGatewayProviders, enableRecursiveGateways, enableWss, enableWebTransport, _supportsSubdomains } = useContext(ConfigContext) + const { setConfig, resetConfig, gateways, routers, dnsJsonResolvers, debug, enableGatewayProviders, enableRecursiveGateways, enableWss, enableWebTransport, _supportsSubdomains } = useContext(ConfigContext) const [isSaving, setIsSaving] = useState(false) const [error, setError] = useState(null) const [resetKey, setResetKey] = useState(0) @@ -107,14 +107,11 @@ const ConfigPage: FunctionComponent = () => { }, [gateways, routers, dnsJsonResolvers, debug, enableGatewayProviders, enableRecursiveGateways, enableWss, enableWebTransport]) useEffect(() => { - if (isLoading) { - return - } /** * On initial load, we want to send the config to the parent window, so that the reload page can auto-reload if enabled, and the subdomain registered service worker gets the latest config without user interaction. */ void postFromIframeToParentSw() - }, [isLoading]) + }, []) const saveConfig = useCallback(async () => { try { diff --git a/test-e2e/fixtures/config-test-fixtures.ts b/test-e2e/fixtures/config-test-fixtures.ts index 89747ac3..adcfd2ec 100644 --- a/test-e2e/fixtures/config-test-fixtures.ts +++ b/test-e2e/fixtures/config-test-fixtures.ts @@ -1,4 +1,4 @@ -import { test as base, type Page } from '@playwright/test' +import { test as base } from '@playwright/test' import { setConfig } from './set-sw-config.js' import { waitForServiceWorker } from './wait-for-service-worker.js' diff --git a/test-e2e/fixtures/set-sw-config.ts b/test-e2e/fixtures/set-sw-config.ts index 86cac46c..53c4d068 100644 --- a/test-e2e/fixtures/set-sw-config.ts +++ b/test-e2e/fixtures/set-sw-config.ts @@ -227,4 +227,3 @@ export async function getConfig ({ page }: { page: Page }): Promise { return config } -