From 1052e2c489d3591e0a238c55671cdae092549167 Mon Sep 17 00:00:00 2001 From: Mike Ellan <52717970+sonicyeti@users.noreply.github.com> Date: Mon, 22 Mar 2021 11:58:30 -0700 Subject: [PATCH] Updating cards to display accurate latest change timestamp (#3201) Updating cards to display accurate latest change timestamp --- .../app/ui/components/wrapper-home.js | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/insomnia-app/app/ui/components/wrapper-home.js b/packages/insomnia-app/app/ui/components/wrapper-home.js index 5ffe38af6..ee8c6cfb9 100644 --- a/packages/insomnia-app/app/ui/components/wrapper-home.js +++ b/packages/insomnia-app/app/ui/components/wrapper-home.js @@ -363,7 +363,18 @@ class WrapperHome extends React.PureComponent { ? apiSpec.modified : workspaceModified; - let log = ; + // Span spec, workspace and sync related timestamps for card last modified label and sort order + const lastModifiedFrom = [ + workspace?.modified, + workspaceMeta?.modified, + apiSpec?.modified, + workspaceMeta?.cachedGitLastCommitTime, + ]; + const lastModifiedTimestamp = lastModifiedFrom + .filter(isNotNullOrUndefined) + .sort(descendingNumberSort)[0]; + + let log = ; let branch = lastActiveBranch; if ( workspace.scope === WorkspaceScopeKeys.design && @@ -429,16 +440,6 @@ class WrapperHome extends React.PureComponent { return null; } - const lastModifiedFrom = [ - workspace?.modified, - workspaceMeta?.modified, - apiSpec?.modified, - workspaceMeta?.cachedGitLastCommitTime, - ]; - const lastModifiedTimestamp = lastModifiedFrom - .filter(isNotNullOrUndefined) - .sort(descendingNumberSort)[0]; - const card = (