simplify note embed page
This commit is contained in:
		
							parent
							
								
									d583d2cafd
								
							
						
					
					
						commit
						4a2955e088
					
				|  | @ -481,29 +481,7 @@ export class ClientServerService { | |||
| 			reply.removeHeader('X-Frame-Options'); | ||||
| 			reply.header("X-Robots-Tag", "noindex"); | ||||
| 
 | ||||
| 			const note = await this.notesRepository.findOneBy({ | ||||
| 				id: request.params.note, | ||||
| 				visibility: In(['public', 'home']), | ||||
| 			}); | ||||
| 
 | ||||
| 			if (note) { | ||||
| 				const _note = await this.noteEntityService.pack(note); | ||||
| 				const profile = await this.userProfilesRepository.findOneByOrFail({ userId: note.userId }); | ||||
| 				const meta = await this.metaService.fetch(); | ||||
| 				reply.header('Cache-Control', 'public, max-age=15'); | ||||
| 				return await reply.view('note', { | ||||
| 					note: _note, | ||||
| 					profile, | ||||
| 					avatarUrl: await this.userEntityService.getAvatarUrl(await this.usersRepository.findOneByOrFail({ id: note.userId })), | ||||
| 					// TODO: Let locale changeable by instance setting
 | ||||
| 					summary: getNoteSummary(_note), | ||||
| 					instanceName: meta.name ?? 'Misskey', | ||||
| 					icon: meta.iconUrl, | ||||
| 					themeColor: meta.themeColor, | ||||
| 				}); | ||||
| 			} else { | ||||
| 				return await renderBase(reply); | ||||
| 			} | ||||
| 			return await renderBase(reply); | ||||
| 		}); | ||||
| 
 | ||||
| 		// Page
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue