diff --git a/lib/gui/app/components/finish/finish.tsx b/lib/gui/app/components/finish/finish.tsx index 88c4cf2d..36c07613 100644 --- a/lib/gui/app/components/finish/finish.tsx +++ b/lib/gui/app/components/finish/finish.tsx @@ -65,7 +65,7 @@ function FinishPage({ goToMain }: { goToMain: () => void }) { averageFlashingSpeed: averageSpeed, devices: { failed, successful: 0 }, }, - } = flashState.getFlashResults(); + } = flashResults; return ( void }) { skip={skip} errors={errors} mb="32px" + goToMain={goToMain} /> { - return ( -
- ref={refFn} {...props} /> -
- ); -})` - [data-display='table-head'] [data-display='table-cell'] { - width: 50%; - position: sticky; - top: 0; - background-color: ${(props) => props.theme.colors.quartenary.light}; - } +const ErrorsTable = styled((props) => {...props} />)` +&&& [data-display='table-head'], +&&& [data-display='table-body'] { + > [data-display='table-row'] { + > [data-display='table-cell'] { + &:first-child { + width: 30%; + } - [data-display='table-cell']:first-child { - padding-left: 15px; - } + &:nth-child(2) { + width: 20%; + } - [data-display='table-cell']:last-child { - width: 150px; - } - - && [data-display='table-row'] > [data-display='table-cell'] { - padding: 6px 8px; - color: #2a506f; + &:last-child { + width: 50%; + } + } } +} `; const DoneIcon = (props: { skipped: boolean; @@ -71,7 +65,6 @@ const DoneIcon = (props: { marginTop: '-25px', marginLeft: '13px', zIndex: 1, - color: props.color, }, }; return props.allFailed && !props.skipped ? ( @@ -112,12 +105,14 @@ const columns: Array> = [ ]; export function FlashResults({ + goToMain, image = '', errors, results, skip, ...props }: { + goToMain: () => void; image?: string; errors: FlashError[]; skip: boolean; @@ -167,7 +162,7 @@ export function FlashResults({ {results.devices.successful !== 0 ? ( - + {results.devices.successful} @@ -178,7 +173,7 @@ export function FlashResults({ ) : null} {errors.length !== 0 ? ( - + {errors.length} @@ -222,10 +217,14 @@ export function FlashResults({ setShowErrorsInfo(false); resetState(); getDrives() - .filter((drive) => - errors.some((error) => error.device === drive.device), + .map((drive) => { + selection.deselectDrive(drive.device); + return drive.device; + }) + .filter((driveDevice) => + errors.some((error) => error.device === driveDevice), ) - .forEach((drive) => selection.selectDrive(drive.device)); + .forEach((driveDevice) => selection.selectDrive(driveDevice)); goToMain(); }} > diff --git a/lib/gui/app/models/store.ts b/lib/gui/app/models/store.ts index 3b7d1936..ee4a8ae7 100644 --- a/lib/gui/app/models/store.ts +++ b/lib/gui/app/models/store.ts @@ -334,12 +334,12 @@ function storeReducer( action.data.results.averageFlashingSpeed = state.get( 'lastAverageFlashingSpeed', ); + } - if (action.data.results.skip) { - return state - .set('isFlashing', false) - .set('flashResults', Immutable.fromJS(action.data)); - } + if (action.data.skip) { + return state + .set('isFlashing', false) + .set('flashResults', Immutable.fromJS(action.data)); } return state diff --git a/lib/shared/drive-constraints.ts b/lib/shared/drive-constraints.ts index c75bd719..f672a4c9 100644 --- a/lib/shared/drive-constraints.ts +++ b/lib/shared/drive-constraints.ts @@ -73,9 +73,7 @@ export function isSourceDrive( ): boolean { if (selection) { if (selection.drive) { - const sourcePath = selection.drive.devicePath || selection.drive.device; - const drivePath = drive.devicePath || drive.device; - return pathIsInside(sourcePath, drivePath); + return selection.drive.device === drive.device; } if (selection.path) { return sourceIsInsideDrive(selection.path, drive);