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 dde37bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 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,13 @@ function L10nSourceCommitModified({
sourceCommitsBehindCount,
sourceCommitURL,
}: Pick<DocumentEdits, "sourceCommitsBehindCount" | "sourceCommitURL">) {
if (!sourceCommitURL) return <>Metadata does not exist.</>;
console.log(sourceCommitsBehindCount, sourceCommitURL);
if (
!sourceCommitURL ||
(!sourceCommitsBehindCount && sourceCommitsBehindCount !== 0)
) {
return <>Metadata does not exist.</>;
}

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

0 comments on commit dde37bb

Please sign in to comment.