Fixed issue that the NSFW image is not hidden on detail page (#4244)
This commit is contained in:
		
							parent
							
								
									8949aad030
								
							
						
					
					
						commit
						afa52e4d63
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -183,6 +183,12 @@ export default class MediaGallery extends React.PureComponent {
 | 
			
		|||
    visible: !this.props.sensitive,
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  componentWillReceiveProps (nextProps) {
 | 
			
		||||
    if (nextProps.sensitive !== this.props.sensitive) {
 | 
			
		||||
      this.setState({ visible: !nextProps.sensitive });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  handleOpen = () => {
 | 
			
		||||
    this.setState({ visible: !this.state.visible });
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue