mirror of
https://github.com/paricafe/misskey.git
synced 2025-01-31 10:20:16 -06:00
feat: get note updatedAt from backend
This commit is contained in:
parent
b83f0c02bc
commit
0d942aacf8
4 changed files with 4 additions and 1 deletions
|
@ -120,6 +120,7 @@ export interface NoteEventTypes {
|
||||||
updated: {
|
updated: {
|
||||||
cw: string | null;
|
cw: string | null;
|
||||||
text: string;
|
text: string;
|
||||||
|
updatedAt: string;
|
||||||
};
|
};
|
||||||
reacted: {
|
reacted: {
|
||||||
reaction: string;
|
reaction: string;
|
||||||
|
|
|
@ -86,6 +86,7 @@ export class NoteUpdateService {
|
||||||
this.globalEventService.publishNoteStream(note.id, 'updated', {
|
this.globalEventService.publishNoteStream(note.id, 'updated', {
|
||||||
cw: ps.cw,
|
cw: ps.cw,
|
||||||
text: ps.text ?? '', // prevent null
|
text: ps.text ?? '', // prevent null
|
||||||
|
updatedAt: ps.updatedAt.toISOString(),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.userEntityService.isLocalUser(user) && !note.localOnly) {
|
if (this.userEntityService.isLocalUser(user) && !note.localOnly) {
|
||||||
|
|
|
@ -76,7 +76,7 @@ export function useNoteCapture(props: {
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'updated': {
|
case 'updated': {
|
||||||
note.value.updatedAt = new Date().toISOString();
|
note.value.updatedAt = body.updatedAt;
|
||||||
note.value.cw = body.cw;
|
note.value.cw = body.cw;
|
||||||
note.value.text = body.text;
|
note.value.text = body.text;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -256,6 +256,7 @@ export type NoteUpdatedEvent = {
|
||||||
body: {
|
body: {
|
||||||
cw: string | null;
|
cw: string | null;
|
||||||
text: string;
|
text: string;
|
||||||
|
updatedAt: string;
|
||||||
};
|
};
|
||||||
} | {
|
} | {
|
||||||
type: 'pollVoted';
|
type: 'pollVoted';
|
||||||
|
|
Loading…
Reference in a new issue