fix: Make getReviewQueue a Promise
This commit is contained in:
parent
8a6ec0dbc7
commit
fbb27b8947
@ -72,11 +72,14 @@ export default class Application extends React.Component<IProps> {
|
||||
});
|
||||
}
|
||||
|
||||
getReviewQueue = (): IVocab[] => {
|
||||
getReviewQueue = (): Promise<IVocab[]> => {
|
||||
console.log("STUB: Application::getReviewQueue");
|
||||
|
||||
// TODO: Implement
|
||||
return [{
|
||||
return new Promise((res, rej) => {
|
||||
setTimeout(() => {
|
||||
res([
|
||||
{
|
||||
german: ["Wein"],
|
||||
hint: "Worte auf '-um' sind meistens NeutrUM",
|
||||
type: VocabType.NOMEN,
|
||||
@ -99,7 +102,10 @@ export default class Application extends React.Component<IProps> {
|
||||
* hint: "Worte auf \"-a\" sind FeminA",
|
||||
* type: VocabType.NOMEN,
|
||||
* id: 3
|
||||
} */] as IVocab[];
|
||||
} */
|
||||
]);
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
|
||||
getLearners(): ILearner[] {
|
||||
|
@ -86,6 +86,7 @@ const ReviewPageWithRouter = withRouter(
|
||||
[ReviewType.LEVEL]: () => vocabByLevelW(levelId),
|
||||
[ReviewType.QUEUE]: () => vocabByQueueW(),
|
||||
}[reviewType];
|
||||
|
||||
getVocab().then((res: IVocab[]) => {
|
||||
this.vocab = res;
|
||||
vocToQueue();
|
||||
|
Reference in New Issue
Block a user