feat: Visually differentiate unread documents (#1507)
* feat: Visually differentiate unread documents * feat: add document treatment in document preview * fix requested changes Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import { takeRight } from "lodash";
|
||||
import { User, Document, Attachment } from "../models";
|
||||
import { Attachment, Document, User } from "../models";
|
||||
import { getSignedImageUrl } from "../utils/s3";
|
||||
import presentUser from "./user";
|
||||
|
||||
@ -62,8 +62,13 @@ export default async function present(document: Document, options: ?Options) {
|
||||
pinned: undefined,
|
||||
collectionId: undefined,
|
||||
parentDocumentId: undefined,
|
||||
lastViewedAt: undefined,
|
||||
};
|
||||
|
||||
if (!!document.views && document.views.length > 0) {
|
||||
data.lastViewedAt = document.views[0].updatedAt;
|
||||
}
|
||||
|
||||
if (!options.isPublic) {
|
||||
data.pinned = !!document.pinnedById;
|
||||
data.collectionId = document.collectionId;
|
||||
|
Reference in New Issue
Block a user