mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 01:53:08 +02:00
fix: user url
This commit is contained in:
parent
645907851d
commit
485173c915
1 changed files with 8 additions and 8 deletions
|
@ -71,12 +71,12 @@ namespace MisskeyAPI {
|
|||
export const user = (u: Entity.User, host: string | null = null): MegalodonEntity.Account => {
|
||||
host ? host = host.replace("https://", "") : null;
|
||||
let acct = u.username
|
||||
if (u.host) {
|
||||
acct = `${u.username}@${u.host}`
|
||||
}
|
||||
if (host) {
|
||||
acct = `${u.username}@${host}`
|
||||
}
|
||||
if (u.host) {
|
||||
acct = `${u.username}@${u.host}`
|
||||
}
|
||||
return {
|
||||
id: u.id,
|
||||
username: u.username,
|
||||
|
@ -92,7 +92,7 @@ namespace MisskeyAPI {
|
|||
following_count: 0,
|
||||
statuses_count: 0,
|
||||
note: '',
|
||||
url: acct,
|
||||
url: u.host ? `https://${u.host}/@${u.username}` : host ? `https://${host}/@${u.username}` : acct,
|
||||
avatar: u.avatarUrl,
|
||||
avatar_static: u.avatarColor,
|
||||
header: '',
|
||||
|
@ -107,12 +107,12 @@ namespace MisskeyAPI {
|
|||
export const userDetail = (u: Entity.UserDetail, host: string | null = null): MegalodonEntity.Account => {
|
||||
host ? host = host.replace("https://", "") : null;
|
||||
let acct = u.username
|
||||
if (u.host) {
|
||||
acct = `${u.username}@${u.host}`
|
||||
}
|
||||
if (host) {
|
||||
acct = `${u.username}@${host}`
|
||||
}
|
||||
if (u.host) {
|
||||
acct = `${u.username}@${u.host}`
|
||||
}
|
||||
return {
|
||||
id: u.id,
|
||||
username: u.username,
|
||||
|
@ -128,7 +128,7 @@ namespace MisskeyAPI {
|
|||
following_count: u.followingCount,
|
||||
statuses_count: u.notesCount,
|
||||
note: u.description ? u.description : '',
|
||||
url: acct,
|
||||
url: u.host ? `https://${u.host}/@${u.username}` : host ? `https://${host}/@${u.username}` : acct,
|
||||
avatar: u.avatarUrl,
|
||||
avatar_static: u.avatarColor,
|
||||
header: u.bannerUrl,
|
||||
|
|
Loading…
Reference in a new issue