feat: get note updatedAt from backend

This commit is contained in:
Nya Candy 2024-01-27 00:43:07 +08:00 committed by fly_mc
parent b83f0c02bc
commit 0d942aacf8
4 changed files with 4 additions and 1 deletions

View file

@ -120,6 +120,7 @@ export interface NoteEventTypes {
updated: {
cw: string | null;
text: string;
updatedAt: string;
};
reacted: {
reaction: string;

View file

@ -86,6 +86,7 @@ export class NoteUpdateService {
this.globalEventService.publishNoteStream(note.id, 'updated', {
cw: ps.cw,
text: ps.text ?? '', // prevent null
updatedAt: ps.updatedAt.toISOString(),
});
if (this.userEntityService.isLocalUser(user) && !note.localOnly) {

View file

@ -76,7 +76,7 @@ export function useNoteCapture(props: {
}
case 'updated': {
note.value.updatedAt = new Date().toISOString();
note.value.updatedAt = body.updatedAt;
note.value.cw = body.cw;
note.value.text = body.text;
break;

View file

@ -256,6 +256,7 @@ export type NoteUpdatedEvent = {
body: {
cw: string | null;
text: string;
updatedAt: string;
};
} | {
type: 'pollVoted';