Fix message asking to check Apple/Google account for subscription not always shown (#6761)

- This was the case when the app was opened from https://editor.gdevelop.io?initial-dialog=subscription
This commit is contained in:
Florian Rival
2024-07-09 16:42:01 +02:00
committed by GitHub
parent 1d4cb7bef0
commit 3c34a8806b
2 changed files with 34 additions and 8 deletions

View File

@@ -16,6 +16,7 @@ import {
type SubscriptionPlanWithPricingSystems,
type SubscriptionPlanPricingSystem,
type Subscription,
hasMobileAppStoreSubscriptionPlan,
} from '../../Utils/GDevelopServices/Usage';
import EmptyMessage from '../../UI/EmptyMessage';
import { showErrorBox } from '../../UI/Messages/MessageBox';
@@ -745,6 +746,39 @@ export default function SubscriptionDialog({
</EmptyMessage>
</ColumnStackLayout>
</Dialog>
{hasMobileAppStoreSubscriptionPlan(
authenticatedUser.subscription
) && (
<Dialog
open
title={
<Trans>
Subscription with the Apple App store or Google Play store
</Trans>
}
maxWidth="sm"
cannotBeDismissed
actions={[
<FlatButton
key="close"
label={
<Trans>
Understood, I'll check my Apple or Google account
</Trans>
}
onClick={onClose}
/>,
]}
>
<Text>
<Trans>
The subscription of this account was done using Apple or
Google Play. Connect on your account on your Apple or Google
device to manage it.
</Trans>
</Text>
</Dialog>
)}
{!authenticatedUser.authenticated &&
authenticatedUser.loginState !== 'loggingIn' && (
<Dialog

View File

@@ -78,14 +78,6 @@ export const SubscriptionSuggestionProvider = ({
// Would present App Store screen.
} else {
if (hasMobileAppStoreSubscriptionPlan(authenticatedUser.subscription)) {
showAlert({
title: t`Subscription with the Apple App store or Google Play store`,
message: t`The subscription of this account was done using Apple or Google Play. Connect on your account on your Apple or Google device to manage it.`,
});
return;
}
setFilter(subscriptionsFilter || null);
setAnalyticsMetadata(metadata);
}