Operative13 / CS480

1 stars 3 forks source link

Frontend Clock does not go to zero on the game timeout from backend #30

Open David-Hughes3 opened 6 years ago

David-Hughes3 commented 6 years ago

This is a problem generated by how I let all of the components get an initial state before letting the MapView load.

Basically, the clock time is generated by a function that uses to the start time to generate a time in seconds that represents time left. This is stored into a state. Then when the MapView loads with the Clock Countdown view, the state is used to initialize the countdown.

The result is that the clock is several seconds off of the time when the game Document will pass a winner and the game will end.

TRIED: To refactor the function so that the time left is calculated and returned by a function called within the clock. However, this runs into the same Async/Parallel processing/race condition issues from before. The clock will display NaN because the clock is rendered before the time is ready.

jtara1 commented 6 years ago

it seems to be much worse on older, slower devices