[Glitch] Fix an issue where polls with 'expires_at' not set expired
Port 6665362f10 to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
			
			
This commit is contained in:
		
							parent
							
								
									e7655951d7
								
							
						
					
					
						commit
						0a29988edf
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -39,7 +39,8 @@ class Poll extends ImmutablePureComponent { | |||
| 
 | ||||
|   static getDerivedStateFromProps (props, state) { | ||||
|     const { poll, intl } = props; | ||||
|     const expired = poll.get('expired') || (new Date(poll.get('expires_at'))).getTime() < intl.now(); | ||||
|     const expires_at = poll.get('expires_at'); | ||||
|     const expired = poll.get('expired') || expires_at !== null && (new Date(expires_at)).getTime() < intl.now(); | ||||
|     return (expired === state.expired) ? null : { expired }; | ||||
|   } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue