show the regenerate button only on update and after creation

This commit is contained in:
Simone Taeggi 2022-08-25 16:19:33 +02:00
parent ca44733f41
commit 0b4ca50191
2 changed files with 241 additions and 345 deletions

View File

@ -274,19 +274,21 @@ const ApiTokenCreateView = () => {
primaryAction={
canEditInputs && (
<Flex justifyContent="center">
<ButtonWithRightMargin
disabled={isSubmitting}
loading={isSubmitting}
startIcon={<Refresh />}
type="button"
size="S"
variant="tertiary"
>
{formatMessage({
id: 'global.regenerate',
defaultMessage: 'Regenerate',
})}
</ButtonWithRightMargin>
{apiToken?.name && (
<ButtonWithRightMargin
disabled={isSubmitting}
loading={isSubmitting}
startIcon={<Refresh />}
type="button"
size="S"
variant="tertiary"
>
{formatMessage({
id: 'global.regenerate',
defaultMessage: 'Regenerate',
})}
</ButtonWithRightMargin>
)}
<Button
disabled={isSubmitting}
loading={isSubmitting}