Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Run code button states (#927)
Browse files Browse the repository at this point in the history
* add updating state

* remove debug console log

* Merge branch 'development' into run_code_loading

* circular progress inherits it’s coor from the parent button

* disable button when updating

* implementation of runcodebutton states (tests failing)

* fix proptypes not working

* fix/add tests

* add test case

* add logic for buttons error state (read desc.)

This would occur when the frontend cannot communicate with the server, the way this is usually handled is via a timeout. I've added an epic & reducer that will set a timeoutStatus to true after 20 seconds of inactivity from the server (there's an error though). The game should "un-timeout" when it receives a request, this still needs to be done, along with the visuals of the button and the popup message.

* moved timeoutStatus into game

* timeout state changes to true when no response received after x seconds

* Simplified approach to just detect when gameState is not being received

* cleanup

* map timeoutStatus state to button prop

* cleanup++

* tests for error state

* bump version

* fix failing tests
  • Loading branch information
TheseusGrey authored Dec 19, 2018
1 parent 02318c9 commit cebdf27
Show file tree
Hide file tree
Showing 20 changed files with 1,293 additions and 645 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ exports[`<GameView /> shows loading bar whilst game is loading 1`] = `
/>
</styled.div>
<Styled(Unity)
gameDataLoaded={true}
gameDataLoaded={false}
height="100%"
unityContent={
UnityContent {
Expand Down
2 changes: 1 addition & 1 deletion game_frontend/src/components/GameView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class GameView extends Component {
renderUnityView = (unityContent, gameDataLoaded) => {
return (
<StyledUnity
gameDataLoaded
gameDataLoaded={gameDataLoaded}
unityContent={unityContent}
height='100%'
width='100%' />
Expand Down
Loading

0 comments on commit cebdf27

Please sign in to comment.