-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Improve spaced repetition interface #15627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
app/src/card/newCardTab.ts
Outdated
}); | ||
async update() { | ||
const cardsData = await fetchCardsData(); | ||
await renderCardsAndBindEvents(this.element, this.data, cardsData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
源代码中没有以下代码,但是调用的函数里面有,没有影响么?
editor = await bindCardEvent({
app: options.app,
element: this.element,
id: this.data.id,
title: this.data.title,
cardType: this.data.cardType,
cardsData,
});
customObj.editors.push(editor);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该是有问题,等我想想怎么改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不行就分开吧,而且这个函数里面还有个外部的变量。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
基本改完了,等会推上来
可以了,现在不会重复添加事件监听器 |
}); | ||
async update() { | ||
const cardsData = await fetchCardsData(); | ||
await renderCardsAndBindEvents(this.element, this.data, cardsData ,undefined, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不太理解为什么一定要这么重构,可以只改业务么?看上去多了 push
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前的 update 方法完全是坏的,修复之后重复的代码太多所以又抽象成一个函数了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renderCardsAndBindEvents 和 fetchCardsData 看上去是一个重构。并且修改了原有代码业务:在原有的 108 行 添加了 customObj.editors.push(editor); 。这个用肉眼看上去并不能修复之前完全坏的 update 方法,可能还会引出更多的问题。
可以了,现在会销毁旧的 editor |
openTab
updateCards option is null #10331使用新窗口打开
的闪卡与当前正在复习的闪卡不一致 #14149 01在新页签中打开
选项 #14149 02