Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a option to always show offline transactions #942

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions renderer/src/web/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export const defaultConfig = (): Config => ({
smartInitialSearch: true,
lockedInitialSearch: true,
activateStockFilter: false,
activateOfflineFilter: false,
builtinBrowser: false,
hotkey: 'D',
hotkeyHold: 'Ctrl',
Expand Down Expand Up @@ -532,6 +533,13 @@ function upgradeConfig (_config: Config): Config {
config.configVersion = 16
}

if (config.configVersion < 17) {
config.widgets.find(w => w.wmType === 'price-check')!
.activateOfflineFilter = false

config.configVersion = 17
}

return config as unknown as Config
}

Expand Down
1 change: 1 addition & 0 deletions renderer/src/web/overlay/widgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface PriceCheckWidget extends Widget {
smartInitialSearch: boolean
lockedInitialSearch: boolean
activateStockFilter: boolean
activateOfflineFilter: boolean
showCursor: boolean
requestPricePrediction: boolean
builtinBrowser: boolean
Expand Down
1 change: 1 addition & 0 deletions renderer/src/web/price-check/CheckedItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export default defineComponent({
chaosPriceThreshold: widget.value.chaosPriceThreshold,
collapseListings: widget.value.collapseListings,
activateStockFilter: widget.value.activateStockFilter,
activateOfflineFilter: widget.value.activateOfflineFilter,
searchStatRange: widget.value.searchStatRange,
useEn: (AppConfig().language === 'cmn-Hant' && AppConfig().realm === 'pc-ggg'),
currency: (prevItem &&
Expand Down
3 changes: 2 additions & 1 deletion renderer/src/web/price-check/filters/create-item-filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface CreateOptions {
currency: string | undefined
collapseListings: 'app' | 'api'
activateStockFilter: boolean
activateOfflineFilter: boolean
exact: boolean
useEn: boolean
}
Expand All @@ -24,7 +25,7 @@ export function createFilters (
const filters: ItemFilters = {
searchExact: {},
trade: {
offline: false,
offline: opts.activateOfflineFilter,
onlineInLeague: false,
listed: undefined,
currency: opts.currency,
Expand Down
1 change: 1 addition & 0 deletions renderer/src/web/price-check/filters/create-presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function createPresets (
currency: string | undefined
collapseListings: 'app' | 'api'
activateStockFilter: boolean
activateOfflineFilter: boolean
searchStatRange: number
useEn: boolean
}
Expand Down
10 changes: 9 additions & 1 deletion renderer/src/web/settings/price-check.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@
</div>
</div>
<div class="mb-2">
<div class="flex-1 mb-1">{{ t(':show_prediction') }} <span class="bg-gray-700 px-1 rounded">www.poeprices.info</span></div>
<div class="flex-1 mb-1">{{ t('Always show offline transactions') }}</div>
<div class="mb-4 flex">
<ui-radio v-model="activateOfflineFilter" :value="true" class="mr-4">{{ t('Yes') }}</ui-radio>
<ui-radio v-model="activateOfflineFilter" :value="false">{{ t('No') }}</ui-radio>
</div>
</div>
<div class="mb-2">
<div class="flex-1 mb-1">{{ t(':show_prediction') }} <span class="bg-gray-700 px-1 rounded">www.poeprices.info</span></div>
<div class="mb-4 flex">
<ui-radio v-model="requestPricePrediction" :value="true" class="mr-4">{{ t('Yes') }}</ui-radio>
<ui-radio v-model="requestPricePrediction" :value="false">{{ t('No') }}</ui-radio>
Expand Down Expand Up @@ -152,6 +159,7 @@ export default defineComponent({
accountName: configModelValue(() => props.config, 'accountName'),
showSeller: configModelValue(() => configWidget.value, 'showSeller'),
activateStockFilter: configModelValue(() => configWidget.value, 'activateStockFilter'),
activateOfflineFilter: configModelValue(() => configWidget.value, 'activateOfflineFilter'),
showCursor: configModelValue(() => configWidget.value, 'showCursor'),
builtinBrowser: configModelValue(() => configWidget.value, 'builtinBrowser'),
requestPricePrediction: configModelValue(() => configWidget.value, 'requestPricePrediction'),
Expand Down