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

@@ -7,13 +7,14 @@ import {
documentPath,
settingsPath,
} from "~/utils/routeHelpers";
import BaseModel from "./BaseModel";
import Comment from "./Comment";
import Document from "./Document";
import User from "./User";
import Model from "./base/Model";
import Field from "./decorators/Field";
import Relation from "./decorators/Relation";
class Notification extends BaseModel {
class Notification extends Model {
@Field
@observable
id: string;
@@ -35,6 +36,7 @@ class Notification extends BaseModel {
/**
* The user that triggered the notification.
*/
@Relation(() => User)
actor?: User;
/**
@@ -45,6 +47,7 @@ class Notification extends BaseModel {
/**
* The document that the notification is associated with.
*/
@Relation(() => Document)
document?: Document;
/**
@@ -55,6 +58,7 @@ class Notification extends BaseModel {
/**
* The comment that the notification is associated with.
*/
@Relation(() => Comment)
comment?: Comment;
/**
@@ -137,9 +141,9 @@ class Notification extends BaseModel {
return this.document ? documentPath(this.document) : "";
}
case NotificationEventType.CreateCollection: {
const collection = this.store.rootStore.documents.get(
this.collectionId
);
const collection = this.collectionId
? this.store.rootStore.documents.get(this.collectionId)
: undefined;
return collection ? collectionPath(collection.url) : "";
}
case NotificationEventType.MentionedInDocument: {