Skip to content

Commit

Permalink
Fix duplication of the "create" action in the search results (#5930)
Browse files Browse the repository at this point in the history
  • Loading branch information
D8H authored Nov 21, 2023
1 parent 639d90d commit 65b78d4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions newIDE/app/src/InstructionOrExpression/EnumerateInstructions.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ const enumerateExtraBehaviorInstructions = (
return allInstructions;
};

/**
* Enumerate free instructions that start with an object parameter.
*/
const enumerateExtraObjectInstructions = (
isCondition: boolean,
extension: gdPlatformExtension,
Expand Down Expand Up @@ -169,6 +172,10 @@ const enumerateExtraObjectInstructions = (
return allInstructions;
};

/**
* Enumerate free instructions excluding the instructions that have been moved to
* the object instructions list unless they are in `freeInstructionsToKeep`.
*/
const enumerateFreeInstructionsWithoutExtra = (
isCondition: boolean,
extension: gdPlatformExtension,
Expand Down Expand Up @@ -414,6 +421,7 @@ export const enumerateObjectAndBehaviorsInstructions = (
const scope = { extension, objectMetadata };
const prefix = '';

// Free instructions
allInstructions = [
...allInstructions,
...enumerateExtensionInstructions(
Expand All @@ -426,7 +434,7 @@ export const enumerateObjectAndBehaviorsInstructions = (
),
];

// Free object instructions:
// Free object instructions
const allExtensions = gd
.asPlatform(gd.JsPlatform.get())
.getAllPlatformExtensions();
Expand Down Expand Up @@ -464,13 +472,6 @@ export const enumerateObjectAndBehaviorsInstructions = (
scope,
i18n
),
...enumerateExtraObjectInstructions(
isCondition,
baseObjectExtension,
baseObjectType,
scope,
i18n
),
];
}

Expand Down

0 comments on commit 65b78d4

Please sign in to comment.