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

Fixing invalidDate error if no timestamp provided

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-07-06 14:50:07 +03:00
parent b4e6aacb84
commit 8d9339d803
2 changed files with 2 additions and 2 deletions

View File

@ -116,7 +116,7 @@ export class LogList extends React.Component<Props> {
return this.props.logs
.map(log => logStore.splitOutTimestamp(log))
.map(([logTimestamp, log]) => (`${moment.tz(logTimestamp, UserStore.getInstance().localeTimezone).format()}${log}`));
.map(([logTimestamp, log]) => (`${logTimestamp && moment.tz(logTimestamp, UserStore.getInstance().localeTimezone).format()}${log}`));
}
/**

View File

@ -183,7 +183,7 @@ export class LogStore {
const extraction = /^(\d+\S+)(.*)/m.exec(logs);
if (!extraction || extraction.length < 3) {
return ["", ""];
return ["", logs];
}
return [extraction[1], extraction[2]];