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