Skip to content

Commit 78995bb

Browse files
committed
Updates fetch messaging when its never fetched
1 parent 168f746 commit 78995bb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/webviews/apps/plus/graph/GraphWrapper.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,8 @@ export function GraphWrapper({
10991099
};
11001100

11011101
const renderFetchAction = () => {
1102-
const fetchedText = lastFetched && fromNow(new Date(lastFetched));
1102+
const lastFetchedDate = lastFetched && new Date(lastFetched);
1103+
const fetchedText = lastFetchedDate && lastFetchedDate.getTime() !== 0 ? fromNow(lastFetchedDate) : undefined;
11031104

11041105
let icon = 'sync';
11051106
let label = 'Fetch';
@@ -1129,7 +1130,7 @@ export function GraphWrapper({
11291130
tooltip += ` ${remote}`;
11301131
fetchTooltip += ` ${remote}`;
11311132
}
1132-
const lastFetchedText = `\nLast fetched ${fetchedText}`;
1133+
const lastFetchedText = fetchedText ? `\nLast fetched ${fetchedText}` : '\nNever fetched';
11331134
tooltip += lastFetchedText;
11341135
fetchTooltip += lastFetchedText;
11351136

0 commit comments

Comments
 (0)