Skip to content

Commit

Permalink
add auto-applied non fractured item filter, closes #1238
Browse files Browse the repository at this point in the history
  • Loading branch information
SnosMe committed Jan 14, 2024
1 parent 6362443 commit 23119c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions renderer/src/web/price-check/filters/create-item-filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ export function createFilters (
filters.mirrored = { disabled: false }
}

if (!item.isFractured && opts.exact) {
filters.fractured = { value: false }
}

if (item.isFoil) {
filters.foil = { disabled: false }
}
Expand Down
3 changes: 3 additions & 0 deletions renderer/src/web/price-check/filters/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export interface ItemFilters {
corrupted?: {
value: boolean
}
fractured?: {
value: boolean
}
mirrored?: {
disabled: boolean
}
Expand Down
4 changes: 4 additions & 0 deletions renderer/src/web/price-check/trade/pathofexile-trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ interface TradeRequest { /* eslint-disable camelcase */
quality?: FilterRange
gem_level?: FilterRange
corrupted?: FilterBoolean
fractured_item?: FilterBoolean
mirrored?: FilterBoolean
identified?: FilterBoolean
stack_size?: FilterRange
Expand Down Expand Up @@ -305,6 +306,9 @@ export function createTradeRequest (filters: ItemFilters, stats: StatFilter[], i
if (filters.corrupted?.value === false) {
propSet(query.filters, 'misc_filters.filters.corrupted.option', String(false))
}
if (filters.fractured?.value === false) {
propSet(query.filters, 'misc_filters.filters.fractured_item.option', String(false))
}
if (filters.mirrored) {
if (filters.mirrored.disabled) {
propSet(query.filters, 'misc_filters.filters.mirrored.option', String(false))
Expand Down

0 comments on commit 23119c2

Please sign in to comment.