chore: lint

This commit is contained in:
Mar0xy 2023-10-01 02:06:04 +02:00
parent 54578f6965
commit 099b86ff3c
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
4 changed files with 7 additions and 14 deletions

View file

@ -263,8 +263,8 @@ export class MastodonApiServerService {
// displayed without being logged in
try {
const data = await client.search((_request.query as any).acct, { type: 'accounts' });
const profile = await this.userProfilesRepository.findOneBy({userId: data.data.accounts[0].id});
data.data.accounts[0].fields = profile?.fields.map(f => ({...f, verified_at: null})) || [];
const profile = await this.userProfilesRepository.findOneBy({ userId: data.data.accounts[0].id });
data.data.accounts[0].fields = profile?.fields.map(f => ({ ...f, verified_at: null })) || [];
reply.send(convertAccount(data.data.accounts[0]));
} catch (e: any) {
/* console.error(e); */
@ -302,8 +302,8 @@ export class MastodonApiServerService {
try {
const sharkId = convertId(_request.params.id, IdType.SharkeyId);
const data = await client.getAccount(sharkId);
const profile = await this.userProfilesRepository.findOneBy({userId: sharkId});
data.data.fields = profile?.fields.map(f => ({...f, verified_at: null})) || [];
const profile = await this.userProfilesRepository.findOneBy({ userId: sharkId });
data.data.fields = profile?.fields.map(f => ({ ...f, verified_at: null })) || [];
reply.send(convertAccount(data.data));
} catch (e: any) {
/* console.error(e);

View file

@ -67,7 +67,7 @@ export class MastoConverters {
public async getUser(id: string): Promise<MiUser> {
return this.GetterService.getUser(id).then(p => {
return p;
})
});
}
public async convertStatus(status: Entity.Status) {
@ -94,7 +94,7 @@ export class MastoConverters {
id: convertId(mention.id, IdConvertType.MastodonId),
}));
const convertedMFM = this.MfmService.toHtml(parse(status.content), JSON.parse(note.mentionedRemoteUsers));
status.content = status.content ? convertedMFM?.replace(/&amp;/g , "&").replaceAll(`<span>&</span><a href="${this.config.url}/tags/39;" rel="tag">#39;</a>` , "<span>\'</span>")! : status.content;
status.content = status.content ? convertedMFM?.replace(/&amp;/g, "&").replaceAll(`<span>&</span><a href="${this.config.url}/tags/39;" rel="tag">#39;</a>`, "<span>\'</span>") as string : status.content;
if (status.poll) status.poll = convertPoll(status.poll);
if (status.reblog) status.reblog = convertStatus(status.reblog);