瀏覽代碼

Move every Attachments.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory client/)

Martin Filser 2 年之前
父節點
當前提交
14ac099e87
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 2 2
      client/components/cards/attachments.js
  2. 1 1
      client/components/settings/attachments.js

+ 2 - 2
client/components/cards/attachments.js

@@ -41,7 +41,7 @@ Template.attachmentGallery.events({
 });
 
 function getNextAttachmentId(currentAttachmentId) {
-    const attachments = Attachments.find({'meta.cardId': cardId}).get();
+    const attachments = ReactiveCache.getAttachments({'meta.cardId': cardId});
 
     let i = 0;
     for (; i < attachments.length; i++) {
@@ -53,7 +53,7 @@ function getNextAttachmentId(currentAttachmentId) {
 }
 
 function getPrevAttachmentId(currentAttachmentId) {
-  const attachments = Attachments.find({'meta.cardId': cardId}).get();
+  const attachments = ReactiveCache.getAttachments({'meta.cardId': cardId});
 
   let i = 0;
   for (; i < attachments.length; i++) {

+ 1 - 1
client/components/settings/attachments.js

@@ -45,7 +45,7 @@ BlazeComponent.extendComponent({
 
 BlazeComponent.extendComponent({
   getBoardsWithAttachments() {
-    this.attachments = Attachments.find().get();
+    this.attachments = ReactiveCache.getAttachments();
     this.attachmentsByBoardId = _.chain(this.attachments)
       .groupBy(fileObj => fileObj.meta.boardId)
       .value();