Merge "Remove unused return true from addParam() method"

This commit is contained in:
jenkins-bot 2023-09-20 14:17:31 +00:00 committed by Gerrit Code Review
commit ae345d50ac
2 changed files with 4 additions and 12 deletions

View file

@ -337,10 +337,8 @@ Model.prototype.importSourceCodeParameters = function () {
// Add sourceCodeParameters to the model
this.sourceCodeParameters.forEach( function ( sourceCodeParameter ) {
if (
existingArray.indexOf( sourceCodeParameter ) === -1 &&
model.addParam( sourceCodeParameter )
) {
if ( existingArray.indexOf( sourceCodeParameter ) === -1 ) {
model.addParam( sourceCodeParameter );
importedArray.push( sourceCodeParameter );
} else {
skippedArray.push( sourceCodeParameter );
@ -386,7 +384,6 @@ Model.prototype.getExistingLanguageCodes = function () {
*
* @param {string} key Parameter key
* @param {Object} [paramData] Parameter data
* @return {boolean} Parameter was added successfully
* @fires add-param
* @fires change
*/
@ -470,7 +467,6 @@ Model.prototype.addParam = function ( key, paramData ) {
// Trigger the add parameter event
this.emit( 'add-param', key, this.params[ key ] );
this.emit( 'change' );
return true;
};
/**

View file

@ -757,14 +757,10 @@ Dialog.prototype.onAddParamButtonClick = function () {
var newParamKey = this.newParamInput.getValue().trim();
if ( this.model.isParamDeleted( newParamKey ) ) {
// Empty param
this.model.emptyParamData( newParamKey );
} else if ( !this.model.isParamExists( newParamKey ) ) {
// Add to model
if ( this.model.addParam( newParamKey ) ) {
// Add parameter to list
this.addParamToSelectWidget( newParamKey );
}
this.model.addParam( newParamKey );
this.addParamToSelectWidget( newParamKey );
}
// Reset the input
this.newParamInput.setValue( '' );