Skip to content

Commit

Permalink
fix(harvest): Move variables before use
Browse files Browse the repository at this point in the history
And we make sure to use the boolean value
  • Loading branch information
Merkur39 authored and PolariTOON committed Feb 3, 2023
1 parent 7b24af5 commit 1aea052
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Expand Up @@ -61,7 +61,7 @@ export const DataTab = ({
<LaunchTriggerCard
konnectorRoot={konnectorRoot}
flow={flow}
withDescription
withMaintenanceDescription
/>
{isMobile && <Divider style={styles.divider} />}
</>
Expand Down
Expand Up @@ -27,9 +27,10 @@ const useStyles = makeStyles({
root: {
padding: '.5rem 1rem'
},
message: {
maxWidth: ({ block }) => block && 'calc(100% - 16px - .5rem)' // 16px is the size of the icon
},
message: ({ block }) =>
block && {
maxWidth: 'calc(100% - 16px - .5rem)' // 16px is the size of the icon
},
action: {
marginRight: '-.5rem'
},
Expand All @@ -43,7 +44,7 @@ export const LaunchTriggerAlert = ({
t,
konnectorRoot,
historyAction,
withDescription
withMaintenanceDescription
}) => {
const client = useClient()
const [showSuccessSnackbar, setShowSuccessSnackbar] = useState(false)
Expand All @@ -53,10 +54,10 @@ export const LaunchTriggerAlert = ({
const {
data: { isInMaintenance, messages: maintenanceMessages }
} = useMaintenanceStatus(client, konnector)
const styles = useStyles({ block })

const isInError = !!error
const block = withDescription && (isInError || isInMaintenance)
const block = isInError || (!!withMaintenanceDescription && isInMaintenance)
const styles = useStyles({ block })
const isKonnectorRunnable = isRunnable({ win: window, konnector })
const isKonnectorDisconnected = isDisconnected(konnector, trigger)

Expand Down

0 comments on commit 1aea052

Please sign in to comment.