Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 5c1fb56

Browse files
1. Fix issue where 7 finalists and 3 winners would throw an error in the console
2. Fix issue where the finalists that are not winners would be left aligned instead of center 3. Fix issue where if we refreshed the page before 10 seconds, an error would be seen in console about uncaught timeout
1 parent a6439e6 commit 5c1fb56

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pages/winners.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Sponsors from '../components/Sponsors'
99
import { checkForMainSponsor } from '../common/helper'
1010

1111
const rowSize = {
12+
4: [1, 2, 1],
1213
5: [2, 1, 2],
1314
7: [2, 3, 2],
1415
8: [3, 2, 3],
@@ -210,7 +211,7 @@ const finalistsLayout = (profiles, props) => {
210211
flex-direction: column;
211212
margin-bottom: 20px;
212213
flex: 1;
213-
align-items: flex-end;
214+
align-items: center;
214215
padding: 0 66px;
215216
}
216217
.rowsContainer {
@@ -618,13 +619,18 @@ const WinnersLayout = (props) => {
618619
class Winners extends React.Component {
619620
constructor (props) {
620621
super(props)
622+
this.timeOutId = null
621623
this.state = {
622624
showWinners: false
623625
}
624626
}
625627

626628
componentDidMount () {
627-
setTimeout(this.toggleWinners.bind(this), 10000)
629+
this.timeOutId = setTimeout(this.toggleWinners.bind(this), 10000)
630+
}
631+
632+
componentWillUnmount () {
633+
clearTimeout(this.timeOutId)
628634
}
629635

630636
toggleWinners () {

0 commit comments

Comments
 (0)