diff --git a/app/javascript/flavours/glitch/api_types/accounts.ts b/app/javascript/flavours/glitch/api_types/accounts.ts index b93054a1f6..913a201fef 100644 --- a/app/javascript/flavours/glitch/api_types/accounts.ts +++ b/app/javascript/flavours/glitch/api_types/accounts.ts @@ -37,7 +37,7 @@ export interface BaseApiAccountJSON { roles?: ApiAccountJSON[]; statuses_count: number; uri: string; - url: string; + url?: string; username: string; moved?: ApiAccountJSON; suspended?: boolean; diff --git a/app/javascript/flavours/glitch/models/account.ts b/app/javascript/flavours/glitch/models/account.ts index c4bf7f6422..ee59e7d393 100644 --- a/app/javascript/flavours/glitch/models/account.ts +++ b/app/javascript/flavours/glitch/models/account.ts @@ -45,7 +45,7 @@ const AccountRoleFactory = ImmutableRecord({ // Account export interface AccountShape extends Required< - Omit + Omit > { emojis: ImmutableList; fields: ImmutableList; @@ -55,6 +55,7 @@ export interface AccountShape note_plain: string | null; hidden: boolean; moved: string | null; + url: string; } export type Account = RecordOf; @@ -148,8 +149,8 @@ export function createAccountFromServerJSON(serverJSON: ApiAccountJSON) { note_emojified: emojify(accountNote, emojiMap), note_plain: unescapeHTML(accountNote), url: - accountJSON.url.startsWith('http://') || - accountJSON.url.startsWith('https://') + accountJSON.url?.startsWith('http://') || + accountJSON.url?.startsWith('https://') ? accountJSON.url : accountJSON.uri, });