Created
February 12, 2013 18:47
-
-
Save gabrielhpugliese/4772203 to your computer and use it in GitHub Desktop.
Subscription is not working like it was.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isClient) { | |
Meteor.startup(function(){ | |
Session.set('MediasLoading', true); | |
Meteor.autosubscribe(function(){ | |
Meteor.subscribe('Medias', function(){ | |
Session.set('MediasLoading', false); | |
}); | |
}); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Template.index.top10 = function(){ | |
if (Session.get('MediasLoading')) | |
return; | |
var medias = Medias.find({}, {limit: 10, sort: {tempo: -1}}).fetch(), | |
maior_tempo = medias[0]['tempo']; // Uncaught TypeError: Cannot read property 'tempo' of undefined | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment