From eef67973b3e8e82acb81c66613700ae7519ef72d Mon Sep 17 00:00:00 2001 From: Edouard Vanbelle Date: Fri, 29 May 2026 13:43:15 +0200 Subject: [PATCH] fix(myshares): reload on any change from ShareModal --- static/js/components/shareModal.js | 8 +++++++- static/js/views/myShares/mySharesView.js | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/static/js/components/shareModal.js b/static/js/components/shareModal.js index 1307b9df..fac04542 100644 --- a/static/js/components/shareModal.js +++ b/static/js/components/shareModal.js @@ -107,16 +107,21 @@ const shareModal = { /** @type {HTMLElement|null} — body node injected into Modal */ _bodyEl: null, + /** @type {(() => void)|null} — called after changes are successfully committed */ + _onApplied: null, + // ── Public API ───────────────────────────────────────────────────────────── /** * Open the share modal for a file or folder. * @param {FileItem|FolderItem} item * @param {'file'|'folder'} itemType + * @param {(() => void)=} onApplied - called after changes are successfully committed */ - async open(item, itemType) { + async open(item, itemType, onApplied) { this._item = item; this._itemType = itemType; + this._onApplied = onApplied ?? null; this._localMembers = []; this._localLinks = []; this._newLinks = []; @@ -888,6 +893,7 @@ const shareModal = { ui.setSharedVisualState(item.id, itemType, hasAnyShare); Modal.close(true); + this._onApplied?.(); } catch (err) { console.error('shareModal._applyAll error:', err); if (Modal.confirmBtn) Modal.confirmBtn.disabled = false; diff --git a/static/js/views/myShares/mySharesView.js b/static/js/views/myShares/mySharesView.js index f33ddc79..257d9c8d 100644 --- a/static/js/views/myShares/mySharesView.js +++ b/static/js/views/myShares/mySharesView.js @@ -136,7 +136,11 @@ const mySharesView = { } }, onShareEdit: (resource, resourceType) => { - shareModal.open(resource, /** @type {'file'|'folder'} */ (resourceType)); + shareModal.open(resource, /** @type {'file'|'folder'} */ (resourceType), () => { + this._nextCursor = null; + this._component?.clear(); + this._loadPage(); + }); } }); }