server: improve variable naming

This commit is contained in:
Johann150 2023-02-01 11:30:53 +01:00
parent 7480e27c0c
commit 75b14124f2
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -324,15 +324,15 @@ router.get('/notes/:note', async (ctx, next) => {
if (note) { if (note) {
try { try {
// FIXME: packing with detail may throw an error if the reply or renote is not visible (#8774) // FIXME: packing with detail may throw an error if the reply or renote is not visible (#8774)
const _note = await Notes.pack(note); const packedNote = await Notes.pack(note);
const profile = await UserProfiles.findOneByOrFail({ userId: note.userId }); const profile = await UserProfiles.findOneByOrFail({ userId: note.userId });
const meta = await fetchMeta(); const meta = await fetchMeta();
await ctx.render('note', { await ctx.render('note', {
note: _note, note: packedNote,
profile, profile,
avatarUrl: await Users.getAvatarUrl(await Users.findOneByOrFail({ id: note.userId })), avatarUrl: await Users.getAvatarUrl(await Users.findOneByOrFail({ id: note.userId })),
// TODO: Let locale changeable by instance setting // TODO: Let locale changeable by instance setting
summary: getNoteSummary(_note), summary: getNoteSummary(packedNote),
instanceName: meta.name || 'FoundKey', instanceName: meta.name || 'FoundKey',
icon: meta.iconUrl, icon: meta.iconUrl,
themeColor: meta.themeColor, themeColor: meta.themeColor,