mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
firmware/installPybricksDialog: fix use of useCustomFirmware()
useCustomFirmware() was called multiple times with the same file which resulted in the same file being parsed 3 times. Instead we should only call useCustomFirmware() and pass the results as props instead.
This commit is contained in:
committed by
David Lechner
parent
1e295f8dbf
commit
c8bcddbffd
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2022 The Pybricks Authors
|
||||
// Copyright (c) 2022-2023 The Pybricks Authors
|
||||
// based on https://usehooks-ts.com/react-hook/use-fetch
|
||||
|
||||
import { FirmwareMetadata, FirmwareReader } from '@pybricks/firmware';
|
||||
@@ -15,7 +15,7 @@ import { alertsShowAlert } from '../../alerts/actions';
|
||||
import { Hub } from '../../components/hubPicker';
|
||||
import { ensureError } from '../../utils';
|
||||
|
||||
type FirmwareData = {
|
||||
export type FirmwareData = {
|
||||
firmwareZip: ArrayBuffer;
|
||||
licenseText: string;
|
||||
metadata: FirmwareMetadata;
|
||||
|
||||
Reference in New Issue
Block a user