Fix infinite loading for weapon chart
This commit is contained in:
@@ -39,7 +39,9 @@ export default defineComponent({
|
|||||||
computed: {
|
computed: {
|
||||||
progress () {
|
progress () {
|
||||||
const { weapon: _, ...withoutWeapon } = this.filters || {}
|
const { weapon: _, ...withoutWeapon } = this.filters || {}
|
||||||
return this.store.getWeaponList(withoutWeapon)?.value.progress
|
const data = this.store.getWeaponList(withoutWeapon)?.value
|
||||||
|
if (!data) return this.store.fetchWeapons(withoutWeapon).value.progress
|
||||||
|
return data.progress
|
||||||
},
|
},
|
||||||
colors () {
|
colors () {
|
||||||
// eslint-disable-next-line no-unused-expressions
|
// eslint-disable-next-line no-unused-expressions
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ function fetchWithLoading (url: string, progress: (percentage: number) => void)
|
|||||||
reader.read().then(({ done, value }) => {
|
reader.read().then(({ done, value }) => {
|
||||||
if (done) {
|
if (done) {
|
||||||
controller.close()
|
controller.close()
|
||||||
|
console.log('ended')
|
||||||
|
progress(1)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -181,6 +183,7 @@ export const useKillStore = defineStore('kill', {
|
|||||||
filter = removeNullEntries(filter)
|
filter = removeNullEntries(filter)
|
||||||
let entry = this.weapons.find((e) => objectEqual(unref(e).filter, filter))
|
let entry = this.weapons.find((e) => objectEqual(unref(e).filter, filter))
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
|
console.log(filter)
|
||||||
entry = shallowRef({ filter, data: {} })
|
entry = shallowRef({ filter, data: {} })
|
||||||
this.weapons.push(entry)
|
this.weapons.push(entry)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user