Skip to content

Commit

Permalink
chore: apply self suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki authored Dec 12, 2024
1 parent 0f8e84f commit b0fb6ac
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
17 changes: 0 additions & 17 deletions src/pages/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,6 @@ const ConfigPage: FunctionComponent<ConfigPageProps> = () => {
setError(err as Error)
} finally {
setIsSaving(false)
await getConfig(uiComponentLogger).then((config) => {
// eslint-disable-next-line no-console
console.log('config directly from idb: ', config)
}).catch((err) => {
// eslint-disable-next-line no-console
console.error('error getting config directly from idb: ', err)
})
}
}, [gateways, routers, dnsJsonResolvers, debug, enableGatewayProviders, enableRecursiveGateways, enableWss, enableWebTransport])

Expand All @@ -153,16 +146,6 @@ const ConfigPage: FunctionComponent<ConfigPageProps> = () => {
setResetKey((prev) => prev + 1)
}, [])

console.log('config-page: isLoading', isLoading)

// if (isLoading) {
// return null
// }

// eslint-disable-next-line no-console
console.log('config is done loading: ', { gateways, routers, dnsJsonResolvers, debug, enableGatewayProviders, enableRecursiveGateways, enableWss, enableWebTransport })
// console.log('config directly from idb: ')

return (
<>
{isConfigPage(window.location.hash) ? <Header /> : null}
Expand Down
1 change: 0 additions & 1 deletion test-e2e/config-ui.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { getConfig, getConfigUi, setConfigViaUi } from './fixtures/set-sw-config
test.describe('config-ui', () => {
test('setting the config via UI actually works', async ({ page, protocol, rootDomain }) => {
await page.goto(`${protocol}//${rootDomain}`)
// await waitForServiceWorker(page)

// read the config from the page
const config = await getConfigUi({ page })
Expand Down
12 changes: 0 additions & 12 deletions test-e2e/fixtures/set-sw-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,3 @@ export async function getConfig ({ page }: { page: Page }): Promise<ConfigDb> {
return config
}

// export async function setSubdomainConfig ({ page, config }: { page: Page, config: Partial<ConfigDb> }): Promise<void> {
// await waitForServiceWorker(page)

// await page.evaluate(async (configInPage) => {
// // TODO: we shouldn't need this. We should be able to just post a message to the service worker to reload it's config.
// window.postMessage({ source: 'helia-sw-config-iframe', target: 'PARENT', action: 'RELOAD_CONFIG', config: configInPage }, { targetOrigin: window.location.origin })
// }, {
// gateways: [process.env.KUBO_GATEWAY],
// routers: [process.env.KUBO_GATEWAY],
// ...config
// })
// }

0 comments on commit b0fb6ac

Please sign in to comment.