[FIX] data format when creating progress record
Was using dictionary as code duplicated from home page. Only one value is ever present so dictionary not required.
This commit is contained in:
@@ -264,16 +264,12 @@ export default withRouter(class SetPage extends React.Component {
|
||||
this.setState({
|
||||
loading: true,
|
||||
})
|
||||
const setIds = Object.keys(this.state.selections)
|
||||
.filter(x => this.state.selections[x]);
|
||||
|
||||
const totalTestQuestions = (await Promise.all(setIds.map((setId) =>
|
||||
this.state.db.collection("sets")
|
||||
.doc(setId)
|
||||
const totalTestQuestions = await this.state.db.collection("sets")
|
||||
.doc(this.props.match.params.setId)
|
||||
.collection("vocab")
|
||||
.get()
|
||||
.then(querySnapshot => querySnapshot.docs.length)
|
||||
))).reduce((a, b) => a + b);
|
||||
.then(querySnapshot => querySnapshot.docs.length);
|
||||
|
||||
this.setState({
|
||||
showTestStart: false,
|
||||
|
||||
Reference in New Issue
Block a user