summaryrefslogtreecommitdiffstats
path: root/client/components/sidebar/sidebarArchives.js
diff options
context:
space:
mode:
authorwekan <wekan@wekan-sandstorm.workgroup>2019-05-13 11:01:50 +0200
committerwekan <wekan@wekan-sandstorm.workgroup>2019-05-13 11:01:50 +0200
commitab4fec0f3c6d5a613b309ae6fac41dbb31f1765d (patch)
tree385dbc5f574085f278182014edb7871780f851b9 /client/components/sidebar/sidebarArchives.js
parentb98347947661e5c79f286a4e5d7f11e614dfb43c (diff)
downloadwekan-ab4fec0f3c6d5a613b309ae6fac41dbb31f1765d.tar.gz
wekan-ab4fec0f3c6d5a613b309ae6fac41dbb31f1765d.tar.bz2
wekan-ab4fec0f3c6d5a613b309ae6fac41dbb31f1765d.zip
Fixed #2338 -> Slow opening of big boards with too many archived items
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' },