use id from preloaded gon.post to fix broken liking with guid
closes #5978
This commit is contained in:
parent
be3b2852be
commit
68f7208ff5
3 changed files with 15 additions and 2 deletions
|
|
@ -36,6 +36,7 @@
|
||||||
* Handle empty searchable in HCard gracefully [#5962](https://github.com/diaspora/diaspora/pull/5962)
|
* 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)
|
* 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)
|
* 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
|
## Features
|
||||||
* Hide post title of limited post in comment notification email [#5843](https://github.com/diaspora/diaspora/pull/5843)
|
* 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'
|
'#single-post-interactions' : 'singlePostInteractionsView'
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize : function(options) {
|
initialize : function() {
|
||||||
this.model = new app.models.Post({ id : options.id });
|
this.model = new app.models.Post({ id : gon.post.id });
|
||||||
this.model.preloadOrFetch().done(_.bind(this.initViews, this));
|
this.model.preloadOrFetch().done(_.bind(this.initViews, this));
|
||||||
this.model.interactions.fetch(); //async, yo, might want to throttle this later.
|
this.model.interactions.fetch(); //async, yo, might want to throttle this later.
|
||||||
this.setupLightbox();
|
this.setupLightbox();
|
||||||
|
|
|
||||||
12
spec/javascripts/app/pages/single-post-viewer_spec.js
Normal file
12
spec/javascripts/app/pages/single-post-viewer_spec.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Reference in a new issue