mirror of
https://github.com/discourse/discourse.git
synced 2025-03-22 06:46:39 +08:00
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:
parent
460d431621
commit
1dde6a5355
@ -11,12 +11,18 @@ 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.
|
||||
siteSettings: Ember.computed({
|
||||
get() {
|
||||
return Discourse.SiteSettings;
|
||||
},
|
||||
|
||||
// prevents model created from json to overridde this property
|
||||
set() {
|
||||
return Discourse.SiteSettings;
|
||||
}
|
||||
}),
|
||||
|
||||
@computed("url")
|
||||
shareUrl(url) {
|
||||
const user = Discourse.User.current();
|
||||
|
Loading…
x
Reference in New Issue
Block a user