mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Improve a few things Bis repetita
Do not show in changelog
This commit is contained in:
2
.github/workflows/issues.yml
vendored
2
.github/workflows/issues.yml
vendored
@@ -40,7 +40,7 @@ jobs:
|
||||
This bug is actually known but we currently lack information on how to reproduce it. Could you please tell us more about how it happened in the issue #3453?
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Autocomment known 124 crash removing a node (reference issue comment)
|
||||
if: "${{ contains(github.event.issue.body, 'Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.') }}"
|
||||
if: "${{ contains(github.event.issue.body, 'The node to be removed is not a child of this node') }}"
|
||||
uses: peter-evans/create-or-update-comment@v1
|
||||
with:
|
||||
issue-number: 3453
|
||||
|
@@ -1,6 +1,7 @@
|
||||
// @flow
|
||||
import { Trans } from '@lingui/macro';
|
||||
import { I18n } from '@lingui/react';
|
||||
import { type I18n as I18nType } from '@lingui/core';
|
||||
import * as React from 'react';
|
||||
import Dialog from '../../UI/Dialog';
|
||||
import FlatButton from '../../UI/FlatButton';
|
||||
@@ -48,6 +49,41 @@ export default function ExtensionsSearchDialog({
|
||||
installExtension
|
||||
);
|
||||
|
||||
const installOrImportExtension = async (
|
||||
i18n: I18nType,
|
||||
extensionShortHeader?: ExtensionShortHeader
|
||||
) => {
|
||||
setIsInstalling(true);
|
||||
try {
|
||||
let wasExtensionInstalledOrImported;
|
||||
if (!!extensionShortHeader) {
|
||||
onInstallExtension(extensionShortHeader);
|
||||
wasExtensionInstalledOrImported = await installDisplayedExtension(
|
||||
i18n,
|
||||
project,
|
||||
eventsFunctionsExtensionsState,
|
||||
extensionShortHeader
|
||||
);
|
||||
} else {
|
||||
wasExtensionInstalledOrImported = await importExtension(
|
||||
i18n,
|
||||
eventsFunctionsExtensionsState,
|
||||
project
|
||||
);
|
||||
}
|
||||
|
||||
if (wasExtensionInstalledOrImported) {
|
||||
setExtensionWasInstalled(true);
|
||||
if (onExtensionInstalled) onExtensionInstalled();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} finally {
|
||||
setIsInstalling(false);
|
||||
}
|
||||
};
|
||||
|
||||
const eventsFunctionsExtensionOpener = eventsFunctionsExtensionsState.getEventsFunctionsExtensionOpener();
|
||||
|
||||
return (
|
||||
@@ -73,19 +109,7 @@ export default function ExtensionsSearchDialog({
|
||||
key="import"
|
||||
label={<Trans>Import extension</Trans>}
|
||||
onClick={() => {
|
||||
(async () => {
|
||||
setIsInstalling(true);
|
||||
const wasExtensionImported = await importExtension(
|
||||
i18n,
|
||||
eventsFunctionsExtensionsState,
|
||||
project
|
||||
);
|
||||
if (wasExtensionImported && onExtensionInstalled)
|
||||
onExtensionInstalled();
|
||||
|
||||
setExtensionWasInstalled(wasExtensionImported);
|
||||
setIsInstalling(false);
|
||||
})();
|
||||
installOrImportExtension(i18n);
|
||||
}}
|
||||
disabled={isInstalling}
|
||||
/>
|
||||
@@ -99,28 +123,9 @@ export default function ExtensionsSearchDialog({
|
||||
>
|
||||
<ExtensionStore
|
||||
isInstalling={isInstalling}
|
||||
onInstall={async extensionShortHeader => {
|
||||
setIsInstalling(true);
|
||||
try {
|
||||
onInstallExtension(extensionShortHeader);
|
||||
const wasExtensionInstalled = await installDisplayedExtension(
|
||||
i18n,
|
||||
project,
|
||||
eventsFunctionsExtensionsState,
|
||||
extensionShortHeader
|
||||
);
|
||||
if (wasExtensionInstalled) {
|
||||
setExtensionWasInstalled(true);
|
||||
if (onExtensionInstalled)
|
||||
onExtensionInstalled(extensionShortHeader);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} finally {
|
||||
setIsInstalling(false);
|
||||
}
|
||||
}}
|
||||
onInstall={async extensionShortHeader =>
|
||||
installOrImportExtension(i18n, extensionShortHeader)
|
||||
}
|
||||
project={project}
|
||||
showOnlyWithBehaviors={false}
|
||||
/>
|
||||
|
@@ -40,6 +40,7 @@ import {
|
||||
TRIVIAL_FIRST_BEHAVIOR,
|
||||
TRIVIAL_FIRST_EXTENSION,
|
||||
} from '../Utils/GDevelopServices/Badge';
|
||||
import { type ExtensionShortHeader } from '../Utils/GDevelopServices/Extension';
|
||||
|
||||
const styles = {
|
||||
disabledItem: { opacity: 0.6 },
|
||||
@@ -184,6 +185,33 @@ export default function NewBehaviorDialog({
|
||||
const hasSearchNoResult =
|
||||
!!searchText && !behaviors.length && !deprecatedBehaviors.length;
|
||||
|
||||
const onInstallExtension = async (
|
||||
i18n: I18nType,
|
||||
extensionShortHeader: ExtensionShortHeader
|
||||
) => {
|
||||
setIsInstalling(true);
|
||||
try {
|
||||
const wasExtensionInstalled = await installDisplayedExtension(
|
||||
i18n,
|
||||
project,
|
||||
eventsFunctionsExtensionsState,
|
||||
extensionShortHeader
|
||||
);
|
||||
|
||||
if (wasExtensionInstalled) {
|
||||
// Setting the extension install time will force a reload of
|
||||
// the behavior metadata, and so the list of behaviors.
|
||||
setExtensionInstallTime(Date.now());
|
||||
setCurrentTab('installed');
|
||||
if (scrollView.current) scrollView.current.scrollToBottom();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} finally {
|
||||
setIsInstalling(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<I18n>
|
||||
{({ i18n }) => (
|
||||
@@ -311,30 +339,9 @@ export default function NewBehaviorDialog({
|
||||
<ExtensionStore
|
||||
project={project}
|
||||
isInstalling={isInstalling}
|
||||
onInstall={async extensionShortHeader => {
|
||||
setIsInstalling(true);
|
||||
try {
|
||||
const wasExtensionInstalled = await installDisplayedExtension(
|
||||
i18n,
|
||||
project,
|
||||
eventsFunctionsExtensionsState,
|
||||
extensionShortHeader
|
||||
);
|
||||
|
||||
if (wasExtensionInstalled) {
|
||||
// Setting the extension install time will force a reload of
|
||||
// the behavior metadata, and so the list of behaviors.
|
||||
setExtensionInstallTime(Date.now());
|
||||
setCurrentTab('installed');
|
||||
if (scrollView.current)
|
||||
scrollView.current.scrollToBottom();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} finally {
|
||||
setIsInstalling(false);
|
||||
}
|
||||
}}
|
||||
onInstall={async extensionShortHeader =>
|
||||
onInstallExtension(i18n, extensionShortHeader)
|
||||
}
|
||||
showOnlyWithBehaviors
|
||||
/>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user