1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Refactored code to allow for empty lastStatus object

Signed-off-by: Steve Richards <srichards@mirantis.com>
This commit is contained in:
Steve Richards 2020-10-07 11:58:47 +01:00
parent 888fa88754
commit b5cbfac3f4

View File

@ -58,8 +58,8 @@ export class PodDetailsContainer extends React.Component<Props> {
{status &&
<DrawerItem name={<Trans>Last Status</Trans>}>
<span>
{lastState}{ready ? `, ${_i18n._(t`ready`)}` : ""}
{lastState === 'terminated' ? ` - ${status.lastState.terminated.reason} (${_i18n._(t`exit code`)}: ${status.lastState.terminated.exitCode}),
{lastState ? `${lastState}, ` : ""}
{lastState === 'terminated' ? `${status.lastState.terminated.reason} (${_i18n._(t`exit code`)}: ${status.lastState.terminated.exitCode}),
${_i18n._(t`started at`)}: ${status.lastState.terminated.startedAt}, ${_i18n._(t`finished at`)}: ${status.lastState.terminated.finishedAt}` : ''}
</span>
</DrawerItem>