Skip to content

Commit 40dd2a9

Browse files
authored
Merge pull request #50152 from nextcloud/fix/dashboard/dont-load-hidden-widgets-initially
fix(dashboard): don't initially load items of hidden api widgets
2 parents d4b862e + 0bb7be2 commit 40dd2a9

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

apps/dashboard/src/DashboardApp.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ export default {
299299
300300
const apiWidgetIdsToFetch = Object
301301
.values(this.apiWidgets)
302-
.filter(widget => this.isApiWidgetV2(widget.id))
302+
.filter(widget => this.isApiWidgetV2(widget.id) && this.layout.includes(widget.id))
303303
.map(widget => widget.id)
304304
await Promise.all(apiWidgetIdsToFetch.map(id => this.fetchApiWidgetItems([id], true)))
305305
@@ -397,9 +397,11 @@ export default {
397397
const index = this.layout.indexOf(panel.id)
398398
if (!currentValue && index > -1) {
399399
this.layout.splice(index, 1)
400-
401400
} else {
402401
this.layout.push(panel.id)
402+
if (this.isApiWidgetV2(panel.id)) {
403+
this.fetchApiWidgetItems([panel.id], true)
404+
}
403405
}
404406
Vue.set(this.panels[panel.id], 'mounted', false)
405407
this.saveLayout()

dist/dashboard-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dashboard-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)