Billing portal is created in settings/billing page even if subscription is canceled, causing server internal error. -> Skip back end request Bonus : display settings/billing page with disabled button even if subscription is canceled --------- Co-authored-by: etiennejouan <jouan.etienne@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
30 lines
699 B
TypeScript
30 lines
699 B
TypeScript
import { createState } from '@ui/utilities/state/utils/createState';
|
|
|
|
import { Workspace } from '~/generated/graphql';
|
|
|
|
export type CurrentWorkspace = Pick<
|
|
Workspace,
|
|
| 'id'
|
|
| 'inviteHash'
|
|
| 'logo'
|
|
| 'displayName'
|
|
| 'allowImpersonation'
|
|
| 'featureFlags'
|
|
| 'activationStatus'
|
|
| 'billingSubscriptions'
|
|
| 'currentBillingSubscription'
|
|
| 'workspaceMembersCount'
|
|
| 'isPublicInviteLinkEnabled'
|
|
| 'isGoogleAuthEnabled'
|
|
| 'isMicrosoftAuthEnabled'
|
|
| 'isPasswordAuthEnabled'
|
|
| 'hasValidEntrepriseKey'
|
|
| 'subdomain'
|
|
| 'metadataVersion'
|
|
>;
|
|
|
|
export const currentWorkspaceState = createState<CurrentWorkspace | null>({
|
|
key: 'currentWorkspaceState',
|
|
defaultValue: null,
|
|
});
|