mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 10:25:47 +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";
|
import Composer from "discourse/models/composer";
|
||||||
|
|
||||||
const Post = RestModel.extend({
|
const Post = RestModel.extend({
|
||||||
@computed()
|
|
||||||
siteSettings() {
|
|
||||||
// TODO: Remove this once one instantiate all `Discourse.Post` models via the store.
|
// TODO: Remove this once one instantiate all `Discourse.Post` models via the store.
|
||||||
|
siteSettings: Ember.computed({
|
||||||
|
get() {
|
||||||
return Discourse.SiteSettings;
|
return Discourse.SiteSettings;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// prevents model created from json to overridde this property
|
||||||
|
set() {
|
||||||
|
return Discourse.SiteSettings;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
@computed("url")
|
@computed("url")
|
||||||
shareUrl(url) {
|
shareUrl(url) {
|
||||||
const user = Discourse.User.current();
|
const user = Discourse.User.current();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user