Merge pull request #23 from fancy-flashcard/bug-fixes-#21-#22
Bug fixes #21 #22
This commit is contained in:
commit
7af2eeb8a6
2 changed files with 11 additions and 2 deletions
|
@ -85,8 +85,13 @@ export default class Learn extends LearnProps {
|
|||
this.moveToPrev();
|
||||
});
|
||||
}
|
||||
destroyed() {
|
||||
this.$eventHub.$off(Event.SWIPE_LEFT_IN_LEARN);
|
||||
this.$eventHub.$off(Event.SWIPE_RIGHT_IN_LEARN);
|
||||
}
|
||||
|
||||
updateCurLearningElement() {
|
||||
if (!this.learningSessionManager) return;
|
||||
this.curLearningElement = this.learningSessionManager.getCurrentLearningSessionElementWithCardDetails();
|
||||
this.updateRatingForCurrentLearningElement();
|
||||
saveLearningSessionManagerDataToLocalStorage(this.learningSessionManager);
|
||||
|
@ -177,7 +182,9 @@ export default class Learn extends LearnProps {
|
|||
}
|
||||
|
||||
finishSession() {
|
||||
finishLearningDialog(this, this.getBarsForFinishLearningDialog());
|
||||
finishLearningDialog(this, this.getBarsForFinishLearningDialog(), () => {
|
||||
this.learningSessionManager = null;
|
||||
});
|
||||
}
|
||||
|
||||
getBarsForFinishLearningDialog(): CustomDialogOptionsBarChartBar[] {
|
||||
|
|
|
@ -9,7 +9,8 @@ import { clearLearningSessionManagerDataInLocalStorage } from "./learningSession
|
|||
|
||||
export function finishLearningDialog(
|
||||
context: any,
|
||||
bars: CustomDialogOptionsBarChartBar[]
|
||||
bars: CustomDialogOptionsBarChartBar[],
|
||||
callbackLearningFinished: { (): void }
|
||||
) {
|
||||
const options = {
|
||||
title: "Finish Learning?",
|
||||
|
@ -32,6 +33,7 @@ export function finishLearningDialog(
|
|||
QuitLearningReason.NO_MORE_CARDS
|
||||
);
|
||||
clearLearningSessionManagerDataInLocalStorage();
|
||||
callbackLearningFinished();
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue