summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-01-04 14:47:28 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-04 14:47:28 +0000
commit901adec7f6b9d5372de49112ec388ba9007ef4d9 (patch)
treeb2b5dd538671305ff9df45b1b24a9243aab715a1 /app/assets
parent3bc07a0be9ce3b8f736890a0513283f04796b37e (diff)
downloadgitlab-ce-901adec7f6b9d5372de49112ec388ba9007ef4d9.tar.gz
Add latest changes from gitlab-org/gitlab@14-6-stable-ee
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/editor/source_editor_instance.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/editor/source_editor_instance.js b/app/assets/javascripts/editor/source_editor_instance.js
index 8372a59964b..95a43c2b2d0 100644
--- a/app/assets/javascripts/editor/source_editor_instance.js
+++ b/app/assets/javascripts/editor/source_editor_instance.js
@@ -50,6 +50,10 @@ const utils = {
}
return extensionsStore.get(extensionName);
},
+
+ hasFullApiRegistered: (targetMethods, newMethods) => {
+ return newMethods.find((fn) => !targetMethods.includes(fn)) === undefined;
+ },
};
/** Class representing a Source Editor Instance */
@@ -132,7 +136,9 @@ export default class EditorInstance {
const existingExt = utils.getStoredExtension(extensionsStore, definition.extensionName);
if (existingExt) {
if (isEqual(extension.setupOptions, existingExt.setupOptions)) {
- return existingExt;
+ if (utils.hasFullApiRegistered(this.extensionsAPI, Object.keys(existingExt.api))) {
+ return existingExt;
+ }
}
this.unuseExtension(extensionsStore, existingExt);
}