mirror of
				https://github.com/discourse/discourse-solved.git
				synced 2025-10-30 22:18:42 +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 => { | ||||
|     if (dec.attrs.post_number === 1) { | ||||
|       const topic = dec.getModel().get('topic'); | ||||
|       if (topic.get('accepted_answer')) { | ||||
|         return dec.rawHtml(`<p class="solved">${topic.get('acceptedAnswerHtml')}</p>`); | ||||
|       const postModel = dec.getModel(); | ||||
|       if (postModel) { | ||||
|         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