-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: dont use local storage for text config items #448
fix: dont use local storage for text config items #448
Conversation
…-storage-input-with-it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review
@@ -76,13 +77,9 @@ const dnsJsonValidationFn = (value: string): Error | null => { | |||
} | |||
} | |||
|
|||
const stringValidationFn = (value: string): Error | null => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validation function is optional, and we only use this for debug. removing and not passing validation function for debug input
/** | ||
* We need to make sure that the configDb types are loaded with the values from IDB | ||
*/ | ||
useEffect(() => { | ||
void (async () => { | ||
const config = await getConfig(getUiComponentLogger('config-context')) | ||
setGateways(config.gateways) | ||
setRouters(config.routers) | ||
setDnsJsonResolvers(config.dnsJsonResolvers) | ||
setEnableWss(config.enableWss) | ||
setEnableWebTransport(config.enableWebTransport) | ||
setEnableGatewayProviders(config.enableGatewayProviders) | ||
setEnableRecursiveGateways(config.enableRecursiveGateways) | ||
setDebug(config.debug) | ||
})() | ||
}, []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice if we could do this faster..
const [gateways, setGateways] = useState<string[]>([]) | ||
const [routers, setRouters] = useState<string[]>([]) | ||
const [dnsJsonResolvers, setDnsJsonResolvers] = useState<Record<string, string>>({}) | ||
const [enableWss, setEnableWss] = useState(false) | ||
const [enableWebTransport, setEnableWebTransport] = useState(false) | ||
const [enableGatewayProviders, setEnableGatewayProviders] = useState(false) | ||
const [enableRecursiveGateways, setEnableRecursiveGateways] = useState(false) | ||
const [debug, setDebug] = useState('') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Title
fix: dont use local storage for text config items
Description
Loads config in config-context.tsx, and provides that in config.tsx, and updates save function to save text-input items from context-context to IDB
Fixes #447
Notes & open questions
See #446 for more changes coming.
Change checklist