Skip to content

Commit

Permalink
fix flashing from file
Browse files Browse the repository at this point in the history
  • Loading branch information
freshollie committed Dec 14, 2021
1 parent b51d4f2 commit 4ffe8b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/renderer/pages/flash/steps/FirmwareSelectionStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ const FirmwareStep: StepComponent = ({ onNext }) => {
const target = parseParam("target");

useEffect(() => {
if (target === "local" && activeTab !== "file") {
if (version === "local" && activeTab !== "file") {
setActiveTab("file");
}
}, [setActiveTab, target, activeTab]);
}, [setActiveTab, version, activeTab]);

return (
<FullHeight>
Expand Down Expand Up @@ -99,15 +99,15 @@ const FirmwareStep: StepComponent = ({ onNext }) => {
key="file"
>
<Centered style={{ height: "100%" }}>
{!version && (
{!target && (
<Typography.Text
style={{ textAlign: "center" }}
type="secondary"
>
Select a firmware file
</Typography.Text>
)}
{target === "local" && version && (
{version === "local" && target && (
<Typography.Text
style={{ textAlign: "center" }}
type="secondary"
Expand Down Expand Up @@ -143,12 +143,12 @@ const FirmwareStep: StepComponent = ({ onNext }) => {
}}
>
<FirmwareUploader
selectedFile={target === "local" ? version : undefined}
selectedFile={version === "local" ? target : undefined}
onFileUploaded={(fileId) => {
if (fileId) {
updateParams({
version: fileId,
target: "local",
target: fileId,
version: "local",
});
} else {
updateParams({
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/pages/flash/steps/OverviewStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const FirmwareSummary: React.FC<{ target: string; version: string }> = ({
target,
version,
}) => {
const isFile = target === "local";
const isFile = version === "local";

const releaseInfoQuery = useQuery(
gql(/* GraphQL */ `
Expand Down Expand Up @@ -206,7 +206,7 @@ const FirmwareSummary: React.FC<{ target: string; version: string }> = ({
`),
{
variables: {
fileId: version,
fileId: target,
},
skip: !isFile,
}
Expand Down

0 comments on commit 4ffe8b8

Please sign in to comment.