fix for lint
This commit is contained in:
@ -54,7 +54,7 @@ export async function populateEmoji(emojiName: string, noteUserHost: string | nu
|
||||
|
||||
const queryOrNull = async () => (await Emojis.findOne({
|
||||
name,
|
||||
host
|
||||
host,
|
||||
})) || null;
|
||||
|
||||
const emoji = await cache.fetch(`${name} ${host}`, queryOrNull);
|
||||
@ -62,7 +62,7 @@ export async function populateEmoji(emojiName: string, noteUserHost: string | nu
|
||||
if (emoji == null) return null;
|
||||
|
||||
const isLocal = emoji.host == null;
|
||||
const url = isLocal ? emoji.url : `${config.url}/proxy/image.png?${query({url: emoji.url})}`;
|
||||
const url = isLocal ? emoji.url : `${config.url}/proxy/image.png?${query({ url: emoji.url })}`;
|
||||
|
||||
return {
|
||||
name: emojiName,
|
||||
@ -111,12 +111,12 @@ export async function prefetchEmojis(emojis: { name: string; host: string | null
|
||||
for (const host of hosts) {
|
||||
emojisQuery.push({
|
||||
name: In(notCachedEmojis.filter(e => e.host === host).map(e => e.name)),
|
||||
host: host
|
||||
host: host,
|
||||
});
|
||||
}
|
||||
const _emojis = emojisQuery.length > 0 ? await Emojis.find({
|
||||
where: emojisQuery,
|
||||
select: ['name', 'host', 'url']
|
||||
select: ['name', 'host', 'url'],
|
||||
}) : [];
|
||||
for (const emoji of _emojis) {
|
||||
cache.set(`${emoji.name} ${emoji.host}`, emoji);
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* eslint-disable key-spacing */
|
||||
import { emojiRegex } from './emoji-regex';
|
||||
import { fetchMeta } from './fetch-meta';
|
||||
import { Emojis } from '@/models/index';
|
||||
|
Reference in New Issue
Block a user