Libraries only fetch their data whene expanded

This commit is contained in:
Stefan Zermatten
2021-02-27 10:49:10 +02:00
parent 2a983b0a94
commit dc53e38efe
4 changed files with 27 additions and 19 deletions

View File

@@ -112,9 +112,6 @@ export default {
getPropertyName,
},
meteor: {
$subscribe: {
'libraries': [],
},
libraries(){
return Libraries.find({}, {
sort: {name: 1}

View File

@@ -94,6 +94,17 @@ export default {
meteor: {
$subscribe: {
'libraries': [],
'libraryNodes'(){
if (!this.expandedLibrary) return [[]];
let libraryIds = [];
this.expandedLibrary.forEach((expanded, index) => {
if (expanded){
let library = this.libraries[index];
if (library) libraryIds.push(library._id)
}
});
return [libraryIds];
}
},
libraries(){
return Libraries.find({}, {

View File

@@ -27,11 +27,6 @@
selectedNodeId: String,
},
meteor: {
$subscribe: {
'library'(){
return [this.libraryId]
},
},
library(){
return Libraries.findOne(this.libraryId);
},