summaryrefslogtreecommitdiffstats
path: root/client/components/sidebar/sidebarArchives.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/sidebar/sidebarArchives.js')
-rw-r--r--client/components/sidebar/sidebarArchives.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/client/components/sidebar/sidebarArchives.js b/client/components/sidebar/sidebarArchives.js
index b50043fd..546d7e1a 100644
--- a/client/components/sidebar/sidebarArchives.js
+++ b/client/components/sidebar/sidebarArchives.js
@@ -1,4 +1,26 @@
+const subManager = new SubsManager();
+
BlazeComponent.extendComponent({
+ onCreated() {
+ this.isArchiveReady = new ReactiveVar(false);
+
+ // The pattern we use to manually handle data loading is described here:
+ // https://kadira.io/academy/meteor-routing-guide/content/subscriptions-and-data-management/using-subs-manager
+ // XXX The boardId should be readed from some sort the component "props",
+ // unfortunatly, Blaze doesn't have this notion.
+ this.autorun(() => {
+ const currentBoardId = Session.get('currentBoard');
+ if (!currentBoardId)
+ return;
+ const handle = subManager.subscribe('board', currentBoardId, true);
+ Tracker.nonreactive(() => {
+ Tracker.autorun(() => {
+ this.isArchiveReady.set( handle.ready() );
+ });
+ });
+ });
+ },
+
tabs() {
return [
{ name: TAPi18n.__('cards'), slug: 'cards' },