mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Compare commits
1 Commits
v5.5.230
...
hide-try-o
Author | SHA1 | Date | |
---|---|---|---|
![]() |
326965faaf |
@@ -136,6 +136,9 @@ const PrivateGameTemplateInformationPage = ({
|
|||||||
const { privateGameTemplateListingDatas } = React.useContext(
|
const { privateGameTemplateListingDatas } = React.useContext(
|
||||||
PrivateGameTemplateStoreContext
|
PrivateGameTemplateStoreContext
|
||||||
);
|
);
|
||||||
|
const [isPreviewLinkValid, setIsPreviewLinkValid] = React.useState<boolean>(
|
||||||
|
false
|
||||||
|
);
|
||||||
const {
|
const {
|
||||||
receivedGameTemplates,
|
receivedGameTemplates,
|
||||||
profile,
|
profile,
|
||||||
@@ -416,6 +419,25 @@ const PrivateGameTemplateInformationPage = ({
|
|||||||
[gameTemplate, privateGameTemplateListingData, simulateAppStoreProduct]
|
[gameTemplate, privateGameTemplateListingData, simulateAppStoreProduct]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
React.useEffect(
|
||||||
|
() => {
|
||||||
|
(async () => {
|
||||||
|
if (gameTemplate) {
|
||||||
|
try {
|
||||||
|
const previewLinkResponse = await fetch(
|
||||||
|
gameTemplate.gamePreviewLink
|
||||||
|
);
|
||||||
|
setIsPreviewLinkValid(previewLinkResponse.ok);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Unable to fetch preview link', error);
|
||||||
|
setIsPreviewLinkValid(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
},
|
||||||
|
[gameTemplate]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<I18n>
|
<I18n>
|
||||||
{({ i18n }) => (
|
{({ i18n }) => (
|
||||||
@@ -520,6 +542,7 @@ const PrivateGameTemplateInformationPage = ({
|
|||||||
/>
|
/>
|
||||||
</Line>
|
</Line>
|
||||||
{!isAlreadyReceived &&
|
{!isAlreadyReceived &&
|
||||||
|
isPreviewLinkValid &&
|
||||||
!privateGameTemplateListingData.includedListableProductIds && ( // Bundles don't have a preview link.
|
!privateGameTemplateListingData.includedListableProductIds && ( // Bundles don't have a preview link.
|
||||||
<Column noMargin>
|
<Column noMargin>
|
||||||
<RaisedButton
|
<RaisedButton
|
||||||
|
Reference in New Issue
Block a user