Skip to content

Commit

Permalink
chore: fix build and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Dec 12, 2024
1 parent b0fb6ac commit 489519d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/pages/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -82,7 +82,7 @@ export interface ConfigPageProps extends React.HTMLProps<HTMLElement> {
// Config Page can be loaded either as a page or as a component in the landing helper-ui page
const ConfigPage: FunctionComponent<ConfigPageProps> = () => {
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<Error | null>(null)
const [resetKey, setResetKey] = useState(0)
Expand All @@ -107,14 +107,11 @@ const ConfigPage: FunctionComponent<ConfigPageProps> = () => {
}, [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 {
Expand Down
2 changes: 1 addition & 1 deletion test-e2e/fixtures/config-test-fixtures.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
1 change: 0 additions & 1 deletion test-e2e/fixtures/set-sw-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,3 @@ export async function getConfig ({ page }: { page: Page }): Promise<ConfigDb> {

return config
}

0 comments on commit 489519d

Please sign in to comment.