Compare commits

...

2 Commits

Author SHA1 Message Date
tamaina b205f7746b use Object.assign 2023-08-12 12:56:37 +00:00
tamaina 6e8d3e5bce trace get 2023-08-12 10:40:34 +00:00
1 changed files with 10 additions and 5 deletions

View File

@ -185,21 +185,26 @@ export class NoteManager {
const files = note.fileIds.map(id => driveFileManager.get(id)?.value);
const result = {
...note,
const result = Object.assign({}, note, {
user: user.value,
renote: renote?.value ?? undefined,
reply: reply?.value ?? undefined,
files: files.filter(file => file) as DriveFile[],
};
});
if (this.isDebuggerEnabled) console.log('NoteManager: compute note: not null', id, result);
return result;
}));
if (this.isDebuggerEnabled) console.log('NoteManager: get note (new)', id, this.notesComputed.get(id));
if (this.isDebuggerEnabled) {
console.log('NoteManager: get note (new)', id, this.notesComputed.get(id));
console.trace();
}
} else {
if (this.isDebuggerEnabled) console.log('NoteManager: get note (cached)', id, this.notesComputed.get(id), this.notesSource.value.get(id));
if (this.isDebuggerEnabled) {
console.log('NoteManager: get note (cached)', id, this.notesComputed.get(id), this.notesSource.value.get(id));
console.trace();
}
}
return this.notesComputed.get(id)!;
}