Fix attachments section not updated when attachments are changed (#3992)

fix: #3989
This commit is contained in:
windingwind 2024-04-17 17:12:32 +08:00 committed by GitHub
parent 80ac628d98
commit e2b72944be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -96,6 +96,9 @@
}
notify(action, type, ids) {
if (ids.includes(this._item?.id)) {
this._resetRenderedFlags();
}
if (!this._item?.isRegularItem()) return;
this._updateAttachmentIDs().then(() => {

View file

@ -95,11 +95,15 @@ class ItemPaneSectionElementBase extends XULElementBase {
return false;
}
async _forceRenderAll() {
if (this.hidden) return;
_resetRenderedFlags() {
// Clear cached flags to allow re-rendering
delete this._syncRenderItemID;
delete this._asyncRenderItemID;
}
async _forceRenderAll() {
if (this.hidden) return;
this._resetRenderedFlags();
if (this.render) this.render();
if (this.asyncRender) await this.asyncRender();
}