mirror of
https://github.com/discourse/discourse-solved.git
synced 2025-02-17 09:04:56 +00:00
FIX: In case called during a test
This commit is contained in:
parent
652000a58b
commit
9fa384e1db
@ -145,9 +145,12 @@ function initializeWithApi(api) {
|
|||||||
|
|
||||||
api.decorateWidget('post-contents:after-cooked', dec => {
|
api.decorateWidget('post-contents:after-cooked', dec => {
|
||||||
if (dec.attrs.post_number === 1) {
|
if (dec.attrs.post_number === 1) {
|
||||||
const topic = dec.getModel().get('topic');
|
const postModel = dec.getModel();
|
||||||
if (topic.get('accepted_answer')) {
|
if (postModel) {
|
||||||
return dec.rawHtml(`<p class="solved">${topic.get('acceptedAnswerHtml')}</p>`);
|
const topic = postModel.get('topic');
|
||||||
|
if (topic.get('accepted_answer')) {
|
||||||
|
return dec.rawHtml(`<p class="solved">${topic.get('acceptedAnswerHtml')}</p>`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user