Merge pull request #50152 from nextcloud/fix/dashboard/dont-load-hidden-widgets-initially

fix(dashboard): don't initially load items of hidden api widgets
This commit is contained in:
Richard Steinmetz 2025-01-14 13:13:50 +01:00 committed by GitHub
commit 40dd2a93bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View file

@ -299,7 +299,7 @@ export default {
const apiWidgetIdsToFetch = Object
.values(this.apiWidgets)
.filter(widget => this.isApiWidgetV2(widget.id))
.filter(widget => this.isApiWidgetV2(widget.id) && this.layout.includes(widget.id))
.map(widget => widget.id)
await Promise.all(apiWidgetIdsToFetch.map(id => this.fetchApiWidgetItems([id], true)))
@ -397,9 +397,11 @@ export default {
const index = this.layout.indexOf(panel.id)
if (!currentValue && index > -1) {
this.layout.splice(index, 1)
} else {
this.layout.push(panel.id)
if (this.isApiWidgetV2(panel.id)) {
this.fetchApiWidgetItems([panel.id], true)
}
}
Vue.set(this.panels[panel.id], 'mounted', false)
this.saveLayout()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long