fix: Initials do not display on notification avatars (#5803)

This commit is contained in:
Tom Moor
2023-09-09 21:01:14 -04:00
committed by GitHub
parent 80ef0a38d6
commit 5c839998c1
65 changed files with 238 additions and 165 deletions

View File

@@ -3,10 +3,11 @@ import { computed, observable } from "mobx";
import { now } from "mobx-utils";
import type { ProsemirrorData } from "@shared/types";
import User from "~/models/User";
import BaseModel from "./BaseModel";
import Model from "./base/Model";
import Field from "./decorators/Field";
import Relation from "./decorators/Relation";
class Comment extends BaseModel {
class Comment extends Model {
/**
* Map to keep track of which users are currently typing a reply in this
* comments thread.
@@ -40,18 +41,16 @@ class Comment extends BaseModel {
@observable
documentId: string;
createdAt: string;
@Relation(() => User)
createdBy: User;
createdById: string;
resolvedAt: string;
@Relation(() => User)
resolvedBy: User;
updatedAt: string;
/**
* An array of users that are currently typing a reply in this comments thread.
*/
@@ -60,7 +59,7 @@ class Comment extends BaseModel {
return Array.from(this.typingUsers.entries())
.filter(([, lastReceivedDate]) => lastReceivedDate > subSeconds(now(), 3))
.map(([userId]) => this.store.rootStore.users.get(userId))
.filter(Boolean);
.filter(Boolean) as User[];
}
}