fix: Make getReviewQueue a Promise
This commit is contained in:
parent
8a6ec0dbc7
commit
fbb27b8947
@ -72,34 +72,40 @@ export default class Application extends React.Component<IProps> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getReviewQueue = (): IVocab[] => {
|
getReviewQueue = (): Promise<IVocab[]> => {
|
||||||
console.log("STUB: Application::getReviewQueue");
|
console.log("STUB: Application::getReviewQueue");
|
||||||
|
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
return [{
|
return new Promise((res, rej) => {
|
||||||
german: ["Wein"],
|
setTimeout(() => {
|
||||||
hint: "Worte auf '-um' sind meistens NeutrUM",
|
res([
|
||||||
type: VocabType.NOMEN,
|
{
|
||||||
latin: {
|
german: ["Wein"],
|
||||||
grundform: "Vinum",
|
hint: "Worte auf '-um' sind meistens NeutrUM",
|
||||||
genitiv: "Vini",
|
type: VocabType.NOMEN,
|
||||||
genus: "Neutrum"
|
latin: {
|
||||||
},
|
grundform: "Vinum",
|
||||||
id: 0
|
genitiv: "Vini",
|
||||||
}/* , {
|
genus: "Neutrum"
|
||||||
* latin: "Vici",
|
},
|
||||||
* german: "<Wortbedeutung>",
|
id: 0
|
||||||
* hint: "Wird \"Viki\" und nicht \"Vichi\" ausgesprochen",
|
}/* , {
|
||||||
* mnemonic: "Merk dir das Wort mit Caesars berühmten Worten: \"Veni Vidi Vici\"; Er kam, sah und siegte",
|
* latin: "Vici",
|
||||||
* type: VocabType.NOMEN,
|
* german: "<Wortbedeutung>",
|
||||||
* id: 2
|
* hint: "Wird \"Viki\" und nicht \"Vichi\" ausgesprochen",
|
||||||
}, {
|
* mnemonic: "Merk dir das Wort mit Caesars berühmten Worten: \"Veni Vidi Vici\"; Er kam, sah und siegte",
|
||||||
* latin: "fuga",
|
* type: VocabType.NOMEN,
|
||||||
* german: "Flucht",
|
* id: 2
|
||||||
* hint: "Worte auf \"-a\" sind FeminA",
|
}, {
|
||||||
* type: VocabType.NOMEN,
|
* latin: "fuga",
|
||||||
* id: 3
|
* german: "Flucht",
|
||||||
} */] as IVocab[];
|
* hint: "Worte auf \"-a\" sind FeminA",
|
||||||
|
* type: VocabType.NOMEN,
|
||||||
|
* id: 3
|
||||||
|
} */
|
||||||
|
]);
|
||||||
|
}, 2000);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getLearners(): ILearner[] {
|
getLearners(): ILearner[] {
|
||||||
|
@ -86,6 +86,7 @@ const ReviewPageWithRouter = withRouter(
|
|||||||
[ReviewType.LEVEL]: () => vocabByLevelW(levelId),
|
[ReviewType.LEVEL]: () => vocabByLevelW(levelId),
|
||||||
[ReviewType.QUEUE]: () => vocabByQueueW(),
|
[ReviewType.QUEUE]: () => vocabByQueueW(),
|
||||||
}[reviewType];
|
}[reviewType];
|
||||||
|
|
||||||
getVocab().then((res: IVocab[]) => {
|
getVocab().then((res: IVocab[]) => {
|
||||||
this.vocab = res;
|
this.vocab = res;
|
||||||
vocToQueue();
|
vocToQueue();
|
||||||
|
Reference in New Issue
Block a user