Merge branch 'lf/fix-last-updated' (#3840)

* origin/lf/fix-last-updated:
  CommentItem: pass date correctly
  groups: filter contacts invites from sidebar
  Sidebar: do not crash on lastUpdated sorting

Signed-off-by: Matilde Park <matilde.park@gmail.com>
This commit is contained in:
Matilde Park 2020-10-29 21:24:00 -04:00
commit 36a27ebe70
3 changed files with 8 additions and 8 deletions

View File

@ -48,7 +48,7 @@ export function CommentItem(props: CommentItemProps) {
showImage
contacts={contacts}
ship={commentData?.author}
date={commentData["date-created"]}
date={commentData?.["time-sent"]}
hideAvatars={props.hideAvatars}
hideNicknames={props.hideNicknames}
>

View File

@ -58,7 +58,7 @@ const SidebarStickySpacer = styled(Box)`
const inviteItems = (invites, api) => {
const returned = [];
Object.keys(invites).filter((e) => {
return e !== '/contacts';
return e !== 'contacts';
}).map((appKey) => {
const app = invites[appKey];
Object.keys(app).map((uid) => {

View File

@ -20,11 +20,11 @@ function sidebarSort(
const lastUpdated = (a: string, b: string) => {
const aAssoc = associations[a];
const bAssoc = associations[b];
const aModule = aAssoc?.metadata?.module || aAssoc?.["app-name"];
const bModule = bAssoc?.metadata?.module || bAssoc?.["app-name"];
const aAppName = aAssoc?.["app-name"];
const bAppName = bAssoc?.["app-name"];
const aUpdated = apps[aModule].lastUpdated(a);
const bUpdated = apps[bModule].lastUpdated(b);
const aUpdated = apps[aAppName].lastUpdated(a);
const bUpdated = apps[bAppName].lastUpdated(b);
return bUpdated - aUpdated || alphabetical(a, b);
};