Copy and past link returns blank page


#1

Yo,

lets say I go paste a url to a post with an id.
www.website.com/post/La5ZtssH

The id should populate the information on the page. If I go from the main page and click on the links to this post page, everything is fine. But if someone copies and pastes from the URL to share the link, So it wrks when sing the app, but not when the link is shared on whatever other app they use, say Skype.

Does anyone know why?

Also when I go from the mainpage to the post page, it works, but when I press refresh in the browser, it is blank again.

By blank, I mean the whole page is white with no error message.


#2

Sounds like a router config/loading issue. Can you share your router config file?


#3

Or are you subscribing in the main page and trying to see that data in your post page?


#4

Router.configure({
layoutTemplate: ‘layout’,
loadingTemplate: ‘loading’,
//waitOn: function() { return Meteor.subscribe(‘patterns’); }
});

PatternsListController = RouteController.extend({
template: ‘main’,
increment: 15,
postsLimit: function() {
return parseInt(this.params.postsLimit) || this.increment;
},
findOptions: function() {
return {sort: this.sort, limit: this.postsLimit()};
},
subscriptions: function() {
this.postsSub = Meteor.subscribe(‘patterns’, this.findOptions());
},
patterns: function() {
return Patterns.find({}, this.findOptions());
},
data: function() {
var self = this;
return {
patterns: self.patterns(),
ready: self.postsSub.ready,
nextPath: function() {
if (self.patterns().count() === self.postsLimit())
return self.nextPath();
}
};
}
});

NewPatternsListController = PatternsListController.extend({
sort: {submitted: -1, _id: -1, subpatternsCount: -1, votes: -1, commentsCount: -1},
nextPath: function() {
return Router.routes.newPatterns.path({postsLimit: this.postsLimit() + this.increment})
}
});

TopPatternsListController = PatternsListController.extend({
template: ‘mainTop’,
sort: {votes: -1, subpatternsCount: -1, commentsCount: -1, submitted: -1, _id: -1},
nextPath: function() {
return Router.routes.topPatterns.path({postsLimit: this.postsLimit() + this.increment})
}
});

SubPatternsListController = PatternsListController.extend({
template: ‘mainSBP’,
sort: {subpatternsCount: -1, votes: -1, commentsCount: -1, submitted: -1, _id: -1},
nextPath: function() {
return Router.routes.newPatterns.path({postsLimit: this.postsLimit() + this.increment})
}
});

CommentsPatternsListController = PatternsListController.extend({
template: ‘mainCMNT’,
sort: {commentsCount: -1, subpatternsCount: -1, votes: -1, submitted: -1, _id: -1},
nextPath: function() {
return Router.routes.cmntsPatterns.path({postsLimit: this.postsLimit() + this.increment})
}
});

Router.route(‘main’, {
path: ‘/’,
controller: NewPatternsListController
});

Router.route(‘newPatterns’, {
path: ‘/new/:postsLimit?’,
controller: NewPatternsListController
});

Router.route(‘topPatterns’, {
path: ‘/top/:postsLimit?’,
controller: TopPatternsListController
});

Router.route(‘subPatterns’, {
path: ‘/sbp/:postsLimit?’,
controller: SubPatternsListController
});

Router.route(‘cmntsPatterns’, {
path: ‘/cmnts/:postsLimit?’,
controller: CommentsPatternsListController
});

Router.route(’/ptrn/:_id’, {
name: ‘patternPage’,
waitOn: function() {
return [
Meteor.subscribe(‘singlePattern’, this.params._id),
Meteor.subscribe(‘patterns’),
Meteor.subscribe(‘comments’, this.params._id),
Meteor.subscribe(‘subpatterns’, this.params._id)
];
},
data: function() { return Patterns.findOne(this.params._id); }
});

Router.route(’/ptrn/:_id/edit’, {
name: ‘patternEdit’,
waitOn: function() {
return Meteor.subscribe(‘singlePattern’, this.params._id);
},
data: function() { return Patterns.findOne(this.params._id); }
});

//search

Router.route(’/srch/’, {
name: ‘searchPage’
});

//Profiles under construction

Router.route(’/usr/:username’, {
name: ‘userProfile’,
waitOn: function() {
Meteor.subscribe(‘patterns’, {sort: {submitted:-1}}),
Meteor.subscribe(‘friendRequests’);
},
data: function() {
return {
user: Meteor.users.findOne({ username: this.params.username }),
patterns: Patterns.find({ creator: this.params.username }, {sort: {submitted:-1}})
};
}
});

//Need to clear errors.
Router.onBeforeAction(function() { clearErrors(); this.next(); } );


#5

should be subscribing separately.


#6

I don’t see your /post/:postId route. Is that somewhere else?

Also, what are you trying to see? Is it in your patterns collection? If you do a Patterns.find().count() in the console, do you see different counts in your two different scenarios?


#7

Router.route(’/ptrn/:_id’, {
name: ‘patternPage’,
waitOn: function() {
return [
Meteor.subscribe(‘singlePattern’, this.params._id),
Meteor.subscribe(‘patterns’),
Meteor.subscribe(‘comments’, this.params._id),
Meteor.subscribe(‘subpatterns’, this.params._id)
];
},
data: function() { return Patterns.findOne(this.params._id); }
});

I use the word pattern instead of post.


#8

on the mainpage I get 15. On the patternPage I get 105.


#9

Do you have the app online somewhere you could share it?


#10

i have to ask the CEO before i can share it.


#11

http://www.subpattern.com/ptrn/YjWsMtmtTYLGcnBLv

If I copy and paste that link into the browser, it returns blank. why?


#12

Looks like you have a couple things going on in the console. Do you have the sacha:spinner package installed?


#13

no. we removed that cause we have another progress bar loading. what is calling the spinner? i tried to remove it from the code.

thanks.


#14

when i search it, it looks like many packages depend on it. So I have added it back, but i still dont use the spinner. now i have this pointless package in my project.

at least this loads properly. thanks.


#15

I’m guessing if you take a look at the loading template, the spinner template is being called…


#16

thanks i found it in the end. Using Atom to search the project and it it didnt come up.