Commit 68f7208f authored by Benjamin Neff's avatar Benjamin Neff Committed by Dennis Schubert

use id from preloaded gon.post to fix broken liking with guid

closes #5978
parent be3b2852
......@@ -36,6 +36,7 @@
* Handle empty searchable in HCard gracefully [#5962](https://github.com/diaspora/diaspora/pull/5962)
* Fix a freeze in new post parsing [#5965](https://github.com/diaspora/diaspora/pull/5965)
* Add case insensitive unconfirmed email addresses as authentication key [#5967](https://github.com/diaspora/diaspora/pull/5967)
* Fix liking on single post views when accessed via GUID [#5978](https://github.com/diaspora/diaspora/pull/5978)
## Features
* Hide post title of limited post in comment notification email [#5843](https://github.com/diaspora/diaspora/pull/5843)
......
......@@ -8,8 +8,8 @@ app.pages.SinglePostViewer = app.views.Base.extend({
'#single-post-interactions' : 'singlePostInteractionsView'
},
initialize : function(options) {
this.model = new app.models.Post({ id : options.id });
initialize : function() {
this.model = new app.models.Post({ id : gon.post.id });
this.model.preloadOrFetch().done(_.bind(this.initViews, this));
this.model.interactions.fetch(); //async, yo, might want to throttle this later.
this.setupLightbox();
......
describe("app.pages.SinglePostViewer", function(){
beforeEach(function() {
window.gon={};gon.post = {id: 42};
this.view = new app.pages.SinglePostViewer();
});
context("#initialize", function() {
it("uses post-id from gon", function() {
expect(this.view.model.id).toBe(gon.post.id);
});
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment