Skip to content

Commit

Permalink
Fix LTI filters - Warbond requires more investigation
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-dolkens committed Nov 29, 2022
1 parent fa7e894 commit 829f2be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/web_resources/HangarXPLOR.Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ var HangarXPLOR = HangarXPLOR || {};
HangarXPLOR.Filter = function (list, filter) {
switch (filter) {
case "HasLTI":
list = $.grep(list, function (item) { return item.filters.has_lti });
list = $.grep(list, function (item) { return item.filters.is_lti });
break;
case "!HasLTI":
list = $.grep(list, function (item) { return !item.filters.has_lti });
list = $.grep(list, function (item) { return !item.filters.is_lti });
break;
case "IsGiftable":
list = $.grep(list, function (item) { return item.filters.is_giftable });
Expand Down
6 changes: 3 additions & 3 deletions src/web_resources/HangarXPLOR.ParsePledge.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ HangarXPLOR.ParsePledge = function()
HangarXPLOR.ParseCoupon.apply(this, [ pledgeName ]);
HangarXPLOR.ParseHangar.apply(this, [ pledgeName ]);

this.melt_value = parseFloat(this.pledge_cost.replace("$", "").replace(",", "").replace(" USD", ""));
if (this.melt_value != this.melt_value) this.melt_value = 0; // NaN safety

this.filters.has_squadron = $('.title:contains(Squadron 42 Digital Download)', this).length > 0;
this.filters.has_starcitizen = $('.title:contains(Star Citizen Digital Download)', this).length > 0;
this.filters.is_warbond = this.pledge_name.toLowerCase().indexOf(' warbond') > -1 || this.pledge_name.toLowerCase().indexOf(' wb') > -1 || this.pledge_name.toLowerCase().indexOf(' war bond') > -1;
this.filters.is_meltable = $('.js-reclaim', this).length > 0;
this.filters.is_giftable = $('.label:contains(Gift)', this).length > 0 && this.melt_value <= 1000;
this.filters.is_package = this.filters.has_squadron || this.filters.has_starcitizen;

this.melt_value = parseFloat(this.pledge_cost.replace("$", "").replace(",", "").replace(" USD", ""));
if (this.melt_value != this.melt_value) this.melt_value = 0; // NaN safety
this.filters.has_value = this.melt_value > 0;

// TODO: Support for js-pledge-configuration-value
Expand Down

0 comments on commit 829f2be

Please sign in to comment.