Skip to content

Commit ca9044c

Browse files
committed
Fix extracted functions being displayed as unknown actions.
1 parent e69e89e commit ca9044c

8 files changed

Lines changed: 18 additions & 15 deletions

File tree

newIDE/app/src/EventsFunctionsExtensionEditor/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type Props = {|
7878
| 'scene-events-editor'
7979
| 'extension-events-editor'
8080
| 'external-events-editor'
81-
) => void,
81+
) => Promise<void>,
8282
onBehaviorEdited?: () => void,
8383
onObjectEdited?: () => void,
8484
onFunctionEdited?: () => void,
@@ -1324,11 +1324,11 @@ export default class EventsFunctionsExtensionEditor extends React.Component<
13241324
});
13251325
};
13261326

1327-
onCreateEventsFunction = (
1327+
onCreateEventsFunction = async (
13281328
extensionName: string,
13291329
eventsFunction: gdEventsFunction
13301330
) => {
1331-
this.props.onCreateEventsFunction(
1331+
await this.props.onCreateEventsFunction(
13321332
extensionName,
13331333
eventsFunction,
13341334
'extension-events-editor'

newIDE/app/src/EventsSheet/EventsFunctionExtractor/EventsFunctionExtractorDialog.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ type Props = {|
3838
objectsContainer: gdObjectsContainer,
3939
serializedEvents: Object,
4040
onClose: () => void,
41-
onCreate: (extensionName: string, eventsFunction: gdEventsFunction) => void,
41+
onCreate: (
42+
extensionName: string,
43+
eventsFunction: gdEventsFunction
44+
) => Promise<void>,
4245
|};
4346

4447
const CREATE_NEW_EXTENSION_PLACEHOLDER = '<create a new extension>';

newIDE/app/src/EventsSheet/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ type Props = {|
187187
onCreateEventsFunction: (
188188
extensionName: string,
189189
eventsFunction: gdEventsFunction
190-
) => void,
190+
) => Promise<void>,
191191
onBeginCreateEventsFunction: () => void,
192192
unsavedChanges?: ?UnsavedChanges,
193193
isActive: boolean,
@@ -2973,8 +2973,8 @@ export class EventsSheetComponentWithoutHandle extends React.Component<
29732973
})
29742974
}
29752975
serializedEvents={this.state.serializedEventsToExtract}
2976-
onCreate={(extensionName, eventsFunction) => {
2977-
onCreateEventsFunction(extensionName, eventsFunction);
2976+
onCreate={async (extensionName, eventsFunction) => {
2977+
await onCreateEventsFunction(extensionName, eventsFunction);
29782978
this._replaceSelectionByEventsFunction(
29792979
extensionName,
29802980
eventsFunction

newIDE/app/src/MainFrame/EditorContainers/BaseEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export type RenderEditorContainerProps = {|
139139
| 'scene-events-editor'
140140
| 'extension-events-editor'
141141
| 'external-events-editor'
142-
) => void,
142+
) => Promise<void>,
143143
onRenamedEventsBasedObject: (
144144
eventsFunctionsExtension: gdEventsFunctionsExtension,
145145
oldName: string,

newIDE/app/src/MainFrame/EditorContainers/EventsEditorContainer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ export class EventsEditorContainer extends React.Component<RenderEditorContainer
158158
});
159159
};
160160

161-
onCreateEventsFunction = (
161+
onCreateEventsFunction = async (
162162
extensionName: string,
163163
eventsFunction: gdEventsFunction
164164
) => {
165-
this.props.onCreateEventsFunction(
165+
await this.props.onCreateEventsFunction(
166166
extensionName,
167167
eventsFunction,
168168
'scene-events-editor'

newIDE/app/src/MainFrame/EditorContainers/ExternalEventsEditorContainer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,11 @@ export class ExternalEventsEditorContainer extends React.Component<
225225
});
226226
};
227227

228-
onCreateEventsFunction = (
228+
onCreateEventsFunction = async (
229229
extensionName: string,
230230
eventsFunction: gdEventsFunction
231231
) => {
232-
this.props.onCreateEventsFunction(
232+
await this.props.onCreateEventsFunction(
233233
extensionName,
234234
eventsFunction,
235235
'external-events-editor'

newIDE/app/src/MainFrame/EditorTabsPane.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export type EditorTabsPaneCommonProps = {|
177177
| 'scene-events-editor'
178178
| 'extension-events-editor'
179179
| 'external-events-editor'
180-
) => void,
180+
) => Promise<void>,
181181
openInstructionOrExpression: (
182182
extension: gdPlatformExtension,
183183
type: string

newIDE/app/src/MainFrame/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3545,7 +3545,7 @@ const MainFrame = (props: Props): React.MixedElement => {
35453545
forceUpdate();
35463546
};
35473547
3548-
const onCreateEventsFunction = (
3548+
const onCreateEventsFunction = async (
35493549
extensionName: string,
35503550
eventsFunction: gdEventsFunction,
35513551
editorIdentifier:
@@ -3577,7 +3577,7 @@ const MainFrame = (props: Props): React.MixedElement => {
35773577
}
35783578
35793579
extension.getEventsFunctions().insertEventsFunction(eventsFunction, 0);
3580-
eventsFunctionsExtensionsState.loadProjectEventsFunctionsExtensions(
3580+
await eventsFunctionsExtensionsState.loadProjectEventsFunctionsExtensions(
35813581
currentProject
35823582
);
35833583
setEditorHotReloadNeeded({

0 commit comments

Comments
 (0)