Skip to content

Commit

Permalink
[frontend] remove code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
isselparra committed Nov 29, 2024
1 parent 08f7437 commit 36a7099
Showing 1 changed file with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ const AtomicTestingHeader = () => {
if (!injectResultOverviewOutput.inject_injector_contract) {
return null;
}
if (injectResultOverviewOutput.inject_ready && !injectResultOverviewOutput.inject_status?.status_id) {
if (injectResultOverviewOutput.inject_ready) {
const launchOrRelaunchKey = !injectResultOverviewOutput.inject_status?.status_id ? 'Launch now' : 'Relaunch now';
return (
<Button
style={{ marginRight: 10 }}
Expand All @@ -90,21 +91,7 @@ const AtomicTestingHeader = () => {
onClick={handleOpenDialog}
disabled={!canLaunch}
>
{t('Launch now')}
</Button>
);
} else if (injectResultOverviewOutput.inject_ready && injectResultOverviewOutput.inject_status?.status_id) {
return (
<Button
style={{ marginRight: 10 }}
startIcon={<PlayArrowOutlined />}
variant="contained"
color="primary"
size="small"
onClick={handleOpenDialog}
disabled={!canLaunch}
>
{t('Relaunch now')}
{t(launchOrRelaunchKey)}
</Button>
);
} else {
Expand Down

0 comments on commit 36a7099

Please sign in to comment.