Skip to content

Conversation

TCOTC
Copy link
Contributor

@TCOTC TCOTC commented Aug 18, 2025

  1. 继续修复 Using openTab updateCards option is null #10331
  2. 修复 使用新窗口打开 的闪卡与当前正在复习的闪卡不一致 #14149 01
  3. 增加 在新页签中打开 选项 #14149 02

@TCOTC TCOTC mentioned this pull request Aug 18, 2025
});
async update() {
const cardsData = await fetchCardsData();
await renderCardsAndBindEvents(this.element, this.data, cardsData);
Copy link
Member

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);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是有问题,等我想想怎么改

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不行就分开吧,而且这个函数里面还有个外部的变量。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

基本改完了,等会推上来

@TCOTC
Copy link
Contributor Author

TCOTC commented Sep 8, 2025

可以了,现在不会重复添加事件监听器

});
async update() {
const cardsData = await fetchCardsData();
await renderCardsAndBindEvents(this.element, this.data, cardsData ,undefined, true);
Copy link
Member

@Vanessa219 Vanessa219 Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不太理解为什么一定要这么重构,可以只改业务么?看上去多了 push

Copy link
Contributor Author

@TCOTC TCOTC Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前的 update 方法完全是坏的,修复之后重复的代码太多所以又抽象成一个函数了

Copy link
Member

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 方法,可能还会引出更多的问题。

@TCOTC
Copy link
Contributor Author

TCOTC commented Sep 9, 2025

可以了,现在会销毁旧的 editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants