Add user preference to always expand toots marked with content warnings (#8762)
This commit is contained in:
		
					parent
					
						
							
								c39183cc62
							
						
					
				
			
			
				commit
				
					
						1889526e23
					
				
			
		
					 11 changed files with 18 additions and 6 deletions
				
			
		|  | @ -1,6 +1,7 @@ | |||
| import escapeTextContentForBrowser from 'escape-html'; | ||||
| import emojify from '../../features/emoji/emoji'; | ||||
| import { unescapeHTML } from '../../utils/html'; | ||||
| import { expandSpoilers } from '../../initial_state'; | ||||
| 
 | ||||
| const domParser = new DOMParser(); | ||||
| 
 | ||||
|  | @ -57,7 +58,7 @@ export function normalizeStatus(status, normalOldStatus) { | |||
|     normalStatus.search_index = domParser.parseFromString(searchContent, 'text/html').documentElement.textContent; | ||||
|     normalStatus.contentHtml  = emojify(normalStatus.content, emojiMap); | ||||
|     normalStatus.spoilerHtml  = emojify(escapeTextContentForBrowser(spoilerText), emojiMap); | ||||
|     normalStatus.hidden       = spoilerText.length > 0 || normalStatus.sensitive; | ||||
|     normalStatus.hidden       = expandSpoilers ? false : spoilerText.length > 0 || normalStatus.sensitive; | ||||
|   } | ||||
| 
 | ||||
|   return normalStatus; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue