mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-13 13:37:31 -07:00
Refactor
This commit is contained in:
parent
59ba7e2b34
commit
d504afa9d1
1 changed files with 4 additions and 4 deletions
|
@ -201,14 +201,14 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise<Us
|
|||
updateUsertags(user!, tags);
|
||||
|
||||
//#region アバターとヘッダー画像をフェッチ
|
||||
const [avatar, banner] = (await Promise.all<DriveFile | null>([
|
||||
const [avatar, banner] = await Promise.all([
|
||||
person.icon,
|
||||
person.image
|
||||
].map(img =>
|
||||
img == null
|
||||
? Promise.resolve(null)
|
||||
: resolveImage(user!, img).catch(() => null)
|
||||
)));
|
||||
));
|
||||
|
||||
const avatarId = avatar ? avatar.id : null;
|
||||
const bannerId = banner ? banner.id : null;
|
||||
|
@ -290,14 +290,14 @@ export async function updatePerson(uri: string, resolver?: Resolver | null, hint
|
|||
logger.info(`Updating the Person: ${person.id}`);
|
||||
|
||||
// アバターとヘッダー画像をフェッチ
|
||||
const [avatar, banner] = (await Promise.all<DriveFile | null>([
|
||||
const [avatar, banner] = await Promise.all([
|
||||
person.icon,
|
||||
person.image
|
||||
].map(img =>
|
||||
img == null
|
||||
? Promise.resolve(null)
|
||||
: resolveImage(exist, img).catch(() => null)
|
||||
)));
|
||||
));
|
||||
|
||||
// カスタム絵文字取得
|
||||
const emojis = await extractEmojis(person.tag || [], exist.host).catch(e => {
|
||||
|
|
Loading…
Reference in a new issue