Hide wrong "this reference is used 0 times" in citation dialog

This fixes a minor regression introduced in Ib003b8a. The problem is
that undefined is not equal to anything in JavaScript, and not smaller
than 2 either.

Bug: T241885
Bug: T335410
Change-Id: Ia6deb291d923b88a08ceac8fbc0efb682e14f358
This commit is contained in:
thiemowmde 2023-04-26 16:34:26 +02:00
parent ad830cce16
commit 2a8fdf3d81

View file

@ -264,9 +264,9 @@ ve.ui.MWReferenceDialog.prototype.useReference = function ( ref ) {
var group = this.getFragment().getDocument().getInternalList()
.getNodeGroup( this.referenceModel.getListGroup() );
var nodes = ve.getProp( group, 'keyedNodes', this.referenceModel.getListKey() );
var usages = nodes && nodes.filter( function ( node ) {
var usages = nodes ? nodes.filter( function ( node ) {
return !node.findParent( ve.dm.MWReferencesListNode );
} ).length;
} ).length : 0;
this.$reuseWarning.toggleClass( 'oo-ui-element-hidden', usages < 2 );
this.$reuseWarningText.text( mw.msg( 'cite-ve-dialog-reference-editing-reused-long', usages ) );