diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-27 09:14:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-27 09:14:11 +0300 |
commit | 8f6f577496d8bcb02bfc7f58defb7ad3ebfde928 (patch) | |
tree | 265876812a2689db1a6383e42bf62eba97cf16f6 /app/assets/javascripts/editor | |
parent | 19c092051188e33e65ff6e6ea5907fb4663bcec9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/editor')
-rw-r--r-- | app/assets/javascripts/editor/source_editor_instance.js | 8 |
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); } |