Skip to content
This repository was archived by the owner on Mar 29, 2021. It is now read-only.

Commit e7fb594

Browse files
committed
fixing is-os check
1 parent 4dc3044 commit e7fb594

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/mods/tier.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ idrinth.tier = {
186186
var makeField = function ( listKey, difficulty, ic ) {
187187
var ln = {
188188
type: 'td',
189-
attributes: []
189+
attributes: [ ]
190190
};
191191
/**
192192
*
@@ -201,8 +201,8 @@ idrinth.tier = {
201201
!idrinth.tier.list[listKey].hasOwnProperty ( 'loot' ) ||
202202
!idrinth.tier.list[listKey].loot.hasOwnProperty ( difficulty ) ||
203203
!idrinth.tier.list[listKey].loot[difficulty].hasOwnProperty ( ic ) ||
204-
!idrinth.tier.list[listKey].loot[difficulty][ic]
205-
) {
204+
!idrinth.tier.list[listKey].loot[difficulty][ic]
205+
) {
206206
return ln;
207207
}
208208
var title = "";
@@ -226,13 +226,22 @@ idrinth.tier = {
226226
* @returns {object} for the buildElement wrapper
227227
*/
228228
var addContent = function ( ln, listKey, difficulty, ic ) {
229+
/**
230+
*
231+
* @param {string} os numeric string
232+
* @param {string} current numeric string
233+
* @returns {Boolean}
234+
*/
235+
var isOs = function ( os, current ) {
236+
return Number.parseInt ( os ) === Number.parseInt ( current );
237+
};
229238
if (
230239
!idrinth.tier.list[listKey].hasOwnProperty ( difficulty ) ||
231240
!idrinth.tier.list[listKey][difficulty].hasOwnProperty ( ic )
232241
) {
233242
return ln;
234243
}
235-
ln.styles = idrinth.tier.list[listKey].os[difficulty] === idrinth.tier.list[listKey][difficulty][ic] ? 'is-os' : '';
244+
ln.styles = isOs ( idrinth.tier.list[listKey].os[difficulty], idrinth.tier.list[listKey][difficulty][ic] ) ? 'is-os' : '';
236245
ln.content = idrinth.ui.formatNumber ( idrinth.tier.list[listKey][difficulty][ic] );
237246
if (
238247
idrinth.tier.list[listKey].epics &&

0 commit comments

Comments
 (0)