Created
January 30, 2013 05:52
-
-
Save SachaG/4671013 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// specific router functions | |
digest = function(year, month, day, view){ | |
var destination = (typeof view === 'undefined') ? 'posts_digest' : 'posts_digest_'+view | |
var currentDate = new Date(); | |
if (typeof day !== 'undefined') { | |
currentDate = new Date(year, month-1, day) | |
} | |
Session.set('currentDate', currentDate); | |
// we need to make sure that the session changes above have been executed | |
// before we can look at the digest handle. XXX: this might be a bad idea | |
Meteor.flush(); | |
if (!currentDigestHandle() || currentDigestHandle().loading()) { | |
return 'loading'; | |
} else { | |
if(!currentDigestHandle().fetch().length){ | |
// ?????? | |
} | |
return destination; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment