Skip to content

Commit

Permalink
[Glitch] Fix mute duration not being shown in list of muted accounts …
Browse files Browse the repository at this point in the history
…in web UI

Port a295832 to glitch-soc

Signed-off-by: Claire <[email protected]>
  • Loading branch information
ClearlyClaire committed Oct 14, 2024
1 parent 9f16543 commit 782a785
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/javascript/flavours/glitch/api_types/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface ApiAccountRoleJSON {
}

// See app/serializers/rest/account_serializer.rb
export interface ApiAccountJSON {
export interface BaseApiAccountJSON {
acct: string;
avatar: string;
avatar_static: string;
Expand Down Expand Up @@ -45,3 +45,12 @@ export interface ApiAccountJSON {
memorial?: boolean;
hide_collections: boolean;
}

// See app/serializers/rest/muted_account_serializer.rb
export interface ApiMutedAccountJSON extends BaseApiAccountJSON {
mute_expires_at?: string | null;
}

// For now, we have the same type representing both `Account` and `MutedAccount`
// objects, but we should refactor this in the future.
export type ApiAccountJSON = ApiMutedAccountJSON;
3 changes: 3 additions & 0 deletions app/javascript/flavours/glitch/models/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export const accountDefaultValues: AccountShape = {
limited: false,
moved: null,
hide_collections: false,
// This comes from `ApiMutedAccountJSON`, but we should eventually
// store that in a different object.
mute_expires_at: null,
};

const AccountFactory = ImmutableRecord<AccountShape>(accountDefaultValues);
Expand Down

0 comments on commit 782a785

Please sign in to comment.