fix(app/editor): set value from outside only if needed (#5445)

pull/5456/head
Chaim Lev-Ari 2021-08-22 12:25:31 +03:00 committed by GitHub
parent bbbc61dca9
commit dcb85ad8fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@ angular.module('portainer.app').controller('CodeEditorController', function Code
var ctrl = this;
this.$onChanges = function $onChanges({ value }) {
if (value && value.currentValue && ctrl.editor) {
if (value && value.currentValue && ctrl.editor && ctrl.editor.getValue() !== value.currentValue) {
ctrl.editor.setValue(value.currentValue);
}
};