mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix bugs
This commit is contained in:
parent
2eb0dcdc39
commit
8712164fa3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
min/custom-navbar.min.js
vendored
2
min/custom-navbar.min.js
vendored
File diff suppressed because one or more lines are too long
@ -889,6 +889,8 @@ class NotifyIframe extends Iframe {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let componentUpdate = () => { }
|
||||||
|
let tabUpdate = () => { }
|
||||||
const getActivityTabComponent = ({ dataObject, apiUrl, name, handleJson, template }) => {
|
const getActivityTabComponent = ({ dataObject, apiUrl, name, handleJson, template }) => {
|
||||||
return {
|
return {
|
||||||
template,
|
template,
|
||||||
@ -918,10 +920,10 @@ const getActivityTabComponent = ({ dataObject, apiUrl, name, handleJson, templat
|
|||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
this.interval = setInterval(() => this.fetchData(true), Activities.updateInterval)
|
componentUpdate = async () => await this.fetchData(true)
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed () {
|
||||||
clearInterval(this.interval)
|
componentUpdate = () => { }
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -949,7 +951,11 @@ class Activities extends NavbarComponent {
|
|||||||
this.onPopup = () => {
|
this.onPopup = () => {
|
||||||
this.setNotifyCount(0)
|
this.setNotifyCount(0)
|
||||||
}
|
}
|
||||||
setInterval(() => this.getNotifyCount(), Activities.updateInterval)
|
setInterval(async () => {
|
||||||
|
await this.getNotifyCount()
|
||||||
|
await tabUpdate()
|
||||||
|
await componentUpdate()
|
||||||
|
}, Activities.updateInterval)
|
||||||
}
|
}
|
||||||
static get updateInterval () {
|
static get updateInterval () {
|
||||||
return 60 * 1000 // 每分钟更新1次动态提醒数字
|
return 60 * 1000 // 每分钟更新1次动态提醒数字
|
||||||
@ -1286,21 +1292,20 @@ class Activities extends NavbarComponent {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.interval = setInterval(() => {
|
tabUpdate = async () => {
|
||||||
for (const tab of this.tabs) {
|
for (const tab of this.tabs) {
|
||||||
if (tab.notifyApi) {
|
if (tab.notifyApi) {
|
||||||
Ajax.getJsonWithCredentials(tab.notifyApi).then(json => {
|
const json = await Ajax.getJsonWithCredentials(tab.notifyApi)
|
||||||
if (json.code !== 0 || !json.data.update_num || this.selectedTab === tab.name) {
|
if (json.code !== 0 || !json.data.update_num || this.selectedTab === tab.name) {
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
tab.notifyCount = json.data.update_num
|
tab.notifyCount = json.data.update_num
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, Activities.updateInterval)
|
}
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed () {
|
||||||
clearInterval(this.interval)
|
tabUpdate = () => { }
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectedTab (name) {
|
selectedTab (name) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user