Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #816 from nextcloud/bugfix/814/allow-loading-a-dif…
Browse files Browse the repository at this point in the history
…ferent-resource-without-remount

Load collections of different resources on change
  • Loading branch information
juliusknorr authored Apr 12, 2022
2 parents 3813d12 + c3aaca8 commit f54beff
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/components/CollectionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ export default {
name: {
type: String,
default: ''
},
isActive: {
type: Boolean,
default: true
}
},
data() {
Expand Down Expand Up @@ -163,12 +167,41 @@ export default {
return options
}
},

watch: {
type() {
if (this.isActive) {
actions.fetchCollectionsByResource({
resourceType: this.type,
resourceId: this.id
})
}
},
id() {
if (this.isActive) {
actions.fetchCollectionsByResource({
resourceType: this.type,
resourceId: this.id
})
}
},
isActive(isActive) {
if (isActive) {
actions.fetchCollectionsByResource({
resourceType: this.type,
resourceId: this.id
})
}
}
},

mounted() {
actions.fetchCollectionsByResource({
resourceType: this.type,
resourceId: this.id
})
},

methods: {
select(selectedOption, id) {
if (selectedOption.method === METHOD_CREATE_COLLECTION) {
Expand Down

0 comments on commit f54beff

Please sign in to comment.