Skip to content

Commit

Permalink
A4A: improve check if pressable subscription exists
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-lysenko committed Dec 6, 2024
1 parent 9ffb111 commit bdcd5bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ export default function usePressableOwnershipType() {
return 'none';
}

// If the agency has a regular Pressable plan (not brought through A4A marketplace), A4A id is null.
const hasRegularPressablePlan =
hasPressablePlan && activeAgency?.third_party?.pressable?.a4a_id === null;
activeAgency?.third_party?.pressable?.subscription?.status === 'active';

return hasRegularPressablePlan ? 'regular' : 'agency';
}, [ activeAgency ] );
Expand Down
4 changes: 4 additions & 0 deletions client/state/a8c-for-agencies/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export interface Agency {
email: string;
name: string;
pressable_id: number;
subscription?: null | {
id?: number;
status?: 'active' | 'canceled';
};
usage?: null | {
status: string;
storage_gb: number;
Expand Down

0 comments on commit bdcd5bc

Please sign in to comment.