Skip to content

Commit

Permalink
fix: consider sourceCommitsBehindCount undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
hochan222 committed Mar 25, 2023
1 parent 94eee57 commit 2d2dba7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/src/translations/differences/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface DocumentEdits {
parentModified: string;
commitURL: string;
parentCommitURL: string;
sourceCommitsBehindCount: number;
sourceCommitsBehindCount?: number;
sourceCommitURL?: string;
}

Expand Down Expand Up @@ -699,7 +699,12 @@ function L10nSourceCommitModified({
sourceCommitsBehindCount,
sourceCommitURL,
}: Pick<DocumentEdits, "sourceCommitsBehindCount" | "sourceCommitURL">) {
if (!sourceCommitURL) return <>Metadata does not exist.</>;
if (
!sourceCommitURL ||
(!sourceCommitsBehindCount && sourceCommitsBehindCount !== 0)
) {
return <>Metadata does not exist.</>;
}

const getImportanceColor = () => {
if (sourceCommitsBehindCount === 0) return "🟢";
Expand Down

0 comments on commit 2d2dba7

Please sign in to comment.