DEV: prevents post.siteSettings computed property to be overridden (#7941)

This happens when loading a post from a json object and is a behavior which will be impossble in future Ember updates.
This commit is contained in:
Joffrey JAFFEUX 2019-07-25 11:54:23 +02:00 committed by GitHub
parent 460d431621
commit 1dde6a5355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,11 +11,17 @@ import { userPath } from "discourse/lib/url";
import Composer from "discourse/models/composer";
const Post = RestModel.extend({
@computed()
siteSettings() {
// TODO: Remove this once one instantiate all `Discourse.Post` models via the store.
return Discourse.SiteSettings;
},
// TODO: Remove this once one instantiate all `Discourse.Post` models via the store.
siteSettings: Ember.computed({
get() {
return Discourse.SiteSettings;
},
// prevents model created from json to overridde this property
set() {
return Discourse.SiteSettings;
}
}),
@computed("url")
shareUrl(url) {