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

@ -339,13 +339,6 @@ export class MfmService {
mention: (node) => { mention: (node) => {
const a = doc.createElement('a'); const a = doc.createElement('a');
const { username, host, acct } = node.props; const { username, host, acct } = node.props;
/* if (mastodon) {
const splitacct = acct.split("@");
a.setAttribute('href', splitacct[2] !== this.config.host && splitacct[2] !== undefined ? `https://${splitacct[2]}/@${splitacct[1]}` : `https://${this.config.host}/${acct}`);
a.className = 'u-url mention';
a.textContent = acct;
return a;
} */
const remoteUserInfo = mentionedRemoteUsers.find(remoteUser => remoteUser.username === username && remoteUser.host === host); const remoteUserInfo = mentionedRemoteUsers.find(remoteUser => remoteUser.username === username && remoteUser.host === host);
a.setAttribute('href', remoteUserInfo ? (remoteUserInfo.url ? remoteUserInfo.url : remoteUserInfo.uri) : `${this.config.url}/${acct}`); a.setAttribute('href', remoteUserInfo ? (remoteUserInfo.url ? remoteUserInfo.url : remoteUserInfo.uri) : `${this.config.url}/${acct}`);
a.className = 'u-url mention'; a.className = 'u-url mention';

View file

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

View file

@ -67,7 +67,7 @@ export class MastoConverters {
public async getUser(id: string): Promise<MiUser> { public async getUser(id: string): Promise<MiUser> {
return this.GetterService.getUser(id).then(p => { return this.GetterService.getUser(id).then(p => {
return p; return p;
}) });
} }
public async convertStatus(status: Entity.Status) { public async convertStatus(status: Entity.Status) {
@ -94,7 +94,7 @@ export class MastoConverters {
id: convertId(mention.id, IdConvertType.MastodonId), id: convertId(mention.id, IdConvertType.MastodonId),
})); }));
const convertedMFM = this.MfmService.toHtml(parse(status.content), JSON.parse(note.mentionedRemoteUsers)); 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.poll) status.poll = convertPoll(status.poll);
if (status.reblog) status.reblog = convertStatus(status.reblog); if (status.reblog) status.reblog = convertStatus(status.reblog);

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
--> -->
<template> <template>
<div ref="el" v-if="!muted" :class="[$style.root, { [$style.children]: depth > 1 }]"> <div v-if="!muted" ref="el" :class="[$style.root, { [$style.children]: depth > 1 }]">
<div :class="$style.main"> <div :class="$style.main">
<div v-if="note.channel" :class="$style.colorBar" :style="{ background: note.channel.color }"></div> <div v-if="note.channel" :class="$style.colorBar" :style="{ background: note.channel.color }"></div>
<MkAvatar :class="$style.avatar" :user="note.user" link preview/> <MkAvatar :class="$style.avatar" :user="note.user" link preview/>