watchstar: use mw.util.isInfinity() instead of comparing to 'infinity'

Bug: T353389
Bug: T353483
Change-Id: I580deb0ba47e4c13643524ddd4d57f1a8e0a35ae
This commit is contained in:
MusikAnimal 2024-02-02 14:10:31 +03:00 committed by Jon Robson
parent 2702cf106c
commit c06d62a531
3 changed files with 9 additions and 9 deletions

14
package-lock.json generated
View file

@ -15,7 +15,7 @@
"@wikimedia/codex": "1.6.0",
"@wikimedia/codex-icons": "1.6.0",
"@wikimedia/mw-node-qunit": "7.2.0",
"@wikimedia/types-wikimedia": "0.4.2",
"@wikimedia/types-wikimedia": "0.4.3",
"eslint-config-wikimedia": "0.27.0",
"eslint-plugin-no-jquery": "2.7.0",
"grunt-banana-checker": "0.13.0",
@ -2792,9 +2792,9 @@
"dev": true
},
"node_modules/@wikimedia/types-wikimedia": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/@wikimedia/types-wikimedia/-/types-wikimedia-0.4.2.tgz",
"integrity": "sha512-MWZJE6JRUYRSuwajjiO4l7xz6530MUqdTOP0t0AteVm8Gqs+hUEcs5tTmAVJDg/ByvzyZ/M/KsW1UcuTRs0N8g==",
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/@wikimedia/types-wikimedia/-/types-wikimedia-0.4.3.tgz",
"integrity": "sha512-c9qY4NUNLsc5OHpFIPd2EMMtqqI5g5PYMSg/ivaDxbn4gJf+1xbFzEC1kQCraCoIWFu9kvXdsMx+ZfhRsSkUaA==",
"dev": true
},
"node_modules/abab": {
@ -15242,9 +15242,9 @@
}
},
"@wikimedia/types-wikimedia": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/@wikimedia/types-wikimedia/-/types-wikimedia-0.4.2.tgz",
"integrity": "sha512-MWZJE6JRUYRSuwajjiO4l7xz6530MUqdTOP0t0AteVm8Gqs+hUEcs5tTmAVJDg/ByvzyZ/M/KsW1UcuTRs0N8g==",
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/@wikimedia/types-wikimedia/-/types-wikimedia-0.4.3.tgz",
"integrity": "sha512-c9qY4NUNLsc5OHpFIPd2EMMtqqI5g5PYMSg/ivaDxbn4gJf+1xbFzEC1kQCraCoIWFu9kvXdsMx+ZfhRsSkUaA==",
"dev": true
},
"abab": {

View file

@ -26,7 +26,7 @@
"@wikimedia/codex": "1.6.0",
"@wikimedia/codex-icons": "1.6.0",
"@wikimedia/mw-node-qunit": "7.2.0",
"@wikimedia/types-wikimedia": "0.4.2",
"@wikimedia/types-wikimedia": "0.4.3",
"eslint-config-wikimedia": "0.27.0",
"eslint-plugin-no-jquery": "2.7.0",
"grunt-banana-checker": "0.13.0",

View file

@ -15,7 +15,7 @@ const updateWatchIcon = ( watchIcon, isWatched, expiry ) => {
);
if ( isWatched ) {
if ( expiry === 'infinity' ) {
if ( mw.util.isInfinity( expiry ) ) {
watchIcon.classList.add( 'mw-ui-icon-wikimedia-unStar' );
} else {
watchIcon.classList.add( 'mw-ui-icon-wikimedia-halfStar' );