mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
fix subscriptionsReady
This commit is contained in:
parent
9eef5fdf07
commit
249fb3fcf8
2 changed files with 4 additions and 2 deletions
|
@ -72,7 +72,7 @@ meteorhacks:kadira@2.20.6
|
|||
meteorhacks:kadira-debug@1.3.3
|
||||
meteorhacks:meteorx@1.3.1
|
||||
meteorhacks:picker@1.0.2
|
||||
meteorhacks:subs-manager@1.3.0
|
||||
meteorhacks:subs-manager@1.4.0
|
||||
meteorspark:util@0.2.0
|
||||
minifiers@1.1.5
|
||||
minimongo@1.0.8
|
||||
|
|
|
@ -15,6 +15,7 @@ Template.posts_list_controller.onCreated(function () {
|
|||
// initialize the reactive variables
|
||||
instance.terms = new ReactiveVar(instance.data.terms);
|
||||
instance.postsLimit = new ReactiveVar(Settings.get('postsPerPage', 10));
|
||||
instance.ready = new ReactiveVar(false);
|
||||
|
||||
// if caching is set to true, use Subs Manager. Else use template.subscribe. Default to false
|
||||
var enableCache = (typeof instance.data.terms.enableCache === "undefined") ? false : instance.data.terms.enableCache;
|
||||
|
@ -56,6 +57,7 @@ Template.posts_list_controller.onCreated(function () {
|
|||
// if subscriptions are ready, set terms to subscriptionsTerms
|
||||
if (subscriptionsReady) {
|
||||
instance.terms.set(subscriptionTerms);
|
||||
instance.ready.set(true);
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -73,7 +75,7 @@ Template.posts_list_controller.helpers({
|
|||
var instance = Template.instance();
|
||||
|
||||
var terms = instance.terms.get(); // ⚡ reactive ⚡
|
||||
var postsReady = instance.subscriptionsReady(); // ⚡ reactive ⚡
|
||||
var postsReady = instance.ready.get(); // ⚡ reactive ⚡
|
||||
|
||||
var postsLimit = terms.limit;
|
||||
var parameters = Posts.getSubParams(terms);
|
||||
|
|
Loading…
Add table
Reference in a new issue