mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
firmware/installPybricksDialog: remove hard-coded hub name size check
The UI has been rearranged so we now have firmware metadata available when we validate the hub name.
This commit is contained in:
committed by
David Lechner
parent
13c69918e1
commit
a841562c6c
@@ -376,15 +376,17 @@ const AcceptLicensePanel: React.VoidFunctionComponent<AcceptLicensePanelProps> =
|
||||
|
||||
type SelectOptionsPanelProps = {
|
||||
hubName: string;
|
||||
metadata: FirmwareMetadata | undefined;
|
||||
onChangeHubName(hubName: string): void;
|
||||
};
|
||||
|
||||
const ConfigureOptionsPanel: React.VoidFunctionComponent<SelectOptionsPanelProps> = ({
|
||||
hubName,
|
||||
metadata,
|
||||
onChangeHubName,
|
||||
}) => {
|
||||
const i18n = useI18n();
|
||||
const isHubNameValid = validateHubName(hubName);
|
||||
const isHubNameValid = metadata ? validateHubName(hubName, metadata) : true;
|
||||
|
||||
return (
|
||||
<div className={dialogBody}>
|
||||
@@ -512,6 +514,11 @@ export const InstallPybricksDialog: React.VoidFunctionComponent = () => {
|
||||
panel={
|
||||
<ConfigureOptionsPanel
|
||||
hubName={hubName}
|
||||
metadata={
|
||||
isCustomFirmwareRequested
|
||||
? customFirmwareData?.metadata
|
||||
: firmwareData?.metadata
|
||||
}
|
||||
onChangeHubName={setHubName}
|
||||
/>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user