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

Commit f54beff

Browse files
authored
Merge pull request #816 from nextcloud/bugfix/814/allow-loading-a-different-resource-without-remount
Load collections of different resources on change
2 parents 3813d12 + c3aaca8 commit f54beff

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/components/CollectionList.vue

+33
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ export default {
111111
name: {
112112
type: String,
113113
default: ''
114+
},
115+
isActive: {
116+
type: Boolean,
117+
default: true
114118
}
115119
},
116120
data() {
@@ -163,12 +167,41 @@ export default {
163167
return options
164168
}
165169
},
170+
171+
watch: {
172+
type() {
173+
if (this.isActive) {
174+
actions.fetchCollectionsByResource({
175+
resourceType: this.type,
176+
resourceId: this.id
177+
})
178+
}
179+
},
180+
id() {
181+
if (this.isActive) {
182+
actions.fetchCollectionsByResource({
183+
resourceType: this.type,
184+
resourceId: this.id
185+
})
186+
}
187+
},
188+
isActive(isActive) {
189+
if (isActive) {
190+
actions.fetchCollectionsByResource({
191+
resourceType: this.type,
192+
resourceId: this.id
193+
})
194+
}
195+
}
196+
},
197+
166198
mounted() {
167199
actions.fetchCollectionsByResource({
168200
resourceType: this.type,
169201
resourceId: this.id
170202
})
171203
},
204+
172205
methods: {
173206
select(selectedOption, id) {
174207
if (selectedOption.method === METHOD_CREATE_COLLECTION) {

0 commit comments

Comments
 (0)