Skip to content

Commit

Permalink
less breaking of everything
Browse files Browse the repository at this point in the history
  • Loading branch information
ak373 committed Aug 30, 2021
1 parent 1c0ad14 commit 2ccc932
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions client/components/SingleLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ class SingleLevel extends React.Component {


async handleNextLevel() {
await this.props.newLevel(this.props.level.id);
const nextLevel = await this.props.newLevel(this.props.level.id);
this.props.history.push(`/level/${this.props.level.id}`);
this.props.changeCode(nextLevel.startingJS);
this.setState({
js: this.props.level.startingJS,
js: nextLevel.startingJS,
testResults: [],
scale: 0,
});
Expand Down
3 changes: 3 additions & 0 deletions client/store/level.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import axios from 'axios';
import { TOKEN } from './auth';
import { changeCode } from './code'

//action types

Expand Down Expand Up @@ -48,6 +49,8 @@ export const nextLevel = (id) => async (dispatch) => {
headers: { authorization: token },
});
dispatch(setLevel(data));
return data;
//changeCode(data.startingJS);
} catch (levelError) {
console.log('These are not the ducks you are looking for', levelError);
}
Expand Down
1 change: 0 additions & 1 deletion script/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ async function seed() {
test: `describe('myIfElseFunction', function(){
it('returns Hold your fire!! when no ducks are advancing', function(){
expect(myIfElseFunction(0)).to.equal('Hold your fire!!');
expect(myIfElseFunction(-10)).to.equal('Hold your fire!!');
});`,
divId: `returns Hold your fire!! when no ducks are advancing`,
});
Expand Down

0 comments on commit 2ccc932

Please sign in to comment.