Handle expired subscriptions in client profile UI
This commit is contained in:
@@ -482,12 +482,17 @@ export function ClientOverviewPage({
|
||||
&& (canonicalSwitch || localSwitch)
|
||||
&& Boolean(operationProfile && operationServer)
|
||||
&& (operationProfile?.id !== appliedProfile?.id || operationServer?.id !== appliedServer?.id);
|
||||
const subscriptionError = error?.context === 'subscription'
|
||||
&& profiles.some((profile) => profile.id === error.profileId
|
||||
&& profile.subscription.errorCode === 'SUBSCRIPTION_EXPIRED')
|
||||
? null
|
||||
: error;
|
||||
const subscriptionFeature = useSubscriptionFeature({
|
||||
profiles,
|
||||
selection: state.selection,
|
||||
connected,
|
||||
operations: visibleOperations,
|
||||
error,
|
||||
error: subscriptionError,
|
||||
isGateway,
|
||||
gatewayDirect,
|
||||
onAdd: onAddProfile,
|
||||
@@ -716,7 +721,7 @@ export function ClientOverviewPage({
|
||||
<SubscriptionPanel
|
||||
feature={subscriptionFeature}
|
||||
statusSlot={<>
|
||||
<InlineError error={subscriptionFeature.error || error} context="subscription" />
|
||||
<InlineError error={subscriptionFeature.error} context="subscription" />
|
||||
</>}
|
||||
renderServerPicker={(profile, pickerState) => <ServerPicker
|
||||
profileId={profile.id}
|
||||
|
||||
Reference in New Issue
Block a user