This commit is contained in:
Alexander Drozdov
2022-12-06 14:10:26 +02:00
parent c26f083afd
commit 3a88f8f121
3 changed files with 5 additions and 8 deletions
+1 -4
View File
@@ -24,9 +24,6 @@ export const selected = computed<string | undefined>({
}
})
export const isPublic = computed<boolean | undefined>(() =>
selected.value ? isPublicLeague(selected.value) : undefined)
export function isPublicLeague (id: string) {
return tradeLeagues.value.some(league => id === league.id)
}
@@ -58,7 +55,7 @@ export async function load () {
}
}
function isRegularLeague (id: string) {
export function isRegularLeague (id: string) {
// not a Private League (PL01)
// not a Race Event (.RE01)
return /^[A-Za-z ]+$/.test(id)
+2 -2
View File
@@ -1,7 +1,7 @@
import { shallowRef, watch } from 'vue'
import { AppConfig } from '@/web/Config'
import { MainProcess } from '@/web/background/IPC'
import { selected as selectedLeague, isPublic as isPublicLeague } from './Leagues'
import { selected as selectedLeague, isPublicLeague } from './Leagues'
interface NinjaDenseInfo {
chaos: number
@@ -20,7 +20,7 @@ const RETRY_TIME = 2 * 60 * 1000
const UPDATE_TIME = 16 * 60 * 1000
async function load (force: boolean = false) {
if (!selectedLeague.value || !isPublicLeague.value || AppConfig().realm !== 'pc-ggg') return
if (!selectedLeague.value || !isPublicLeague(selectedLeague.value) || AppConfig().realm !== 'pc-ggg') return
const leagueAtStartOfLoad = selectedLeague.value
if (!force && (Date.now() - lastUpdateTime) < UPDATE_TIME) return
+2 -2
View File
@@ -63,7 +63,7 @@ import { CATEGORY_TO_TRADE_ID, createTradeRequest } from './trade/pathofexile-tr
import { AppConfig } from '@/web/Config'
import { FilterPreset } from './filters/interfaces'
import { PriceCheckWidget } from '../overlay/interfaces'
import { selected as selectedLeague, isPublic as isPublicLeague } from '@/web/background/Leagues'
import { selected as selectedLeague, isRegularLeague } from '@/web/background/Leagues'
let _showSupportLinksCounter = 0
@@ -173,7 +173,7 @@ export default defineComponent({
const showPredictedPrice = computed(() => {
if (!widget.value.requestPricePrediction ||
AppConfig().language !== 'en' ||
!isPublicLeague.value) return false
!isRegularLeague(selectedLeague.value!)) return false
if (presets.value.active === 'Base item') return false