FIX: Can't cook queued posts when markdown-it is enabled.
This commit is contained in:
parent
a10689de94
commit
5ff563cddd
|
@ -1,6 +1,8 @@
|
||||||
import { propertyEqual } from 'discourse/lib/computed';
|
import { propertyEqual } from 'discourse/lib/computed';
|
||||||
|
import { default as computed } from 'ember-addons/ember-computed-decorators';
|
||||||
import { bufferedProperty } from 'discourse/mixins/buffered-content';
|
import { bufferedProperty } from 'discourse/mixins/buffered-content';
|
||||||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||||
|
import { cookAsync } from 'discourse/lib/text';
|
||||||
|
|
||||||
function updateState(state, opts) {
|
function updateState(state, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
@ -21,6 +23,12 @@ export default Ember.Component.extend(bufferedProperty('post'), {
|
||||||
editing: propertyEqual('post', 'currentlyEditing'),
|
editing: propertyEqual('post', 'currentlyEditing'),
|
||||||
_confirmDelete: updateState('rejected', {deleteUser: true}),
|
_confirmDelete: updateState('rejected', {deleteUser: true}),
|
||||||
|
|
||||||
|
@computed('post.raw')
|
||||||
|
cooked(raw) {
|
||||||
|
cookAsync(raw).then(cooked => this.set('cooked', cooked));
|
||||||
|
return raw;
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
approve: updateState('approved'),
|
approve: updateState('approved'),
|
||||||
reject: updateState('rejected'),
|
reject: updateState('rejected'),
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
{{#if editing}}
|
{{#if editing}}
|
||||||
{{d-editor value=buffered.raw}}
|
{{d-editor value=buffered.raw}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{{cook-text post.raw}}}
|
{{{cooked}}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue