fix(myshares): reload on any change from ShareModal
This commit is contained in:
@@ -107,16 +107,21 @@ const shareModal = {
|
|||||||
/** @type {HTMLElement|null} — body node injected into Modal */
|
/** @type {HTMLElement|null} — body node injected into Modal */
|
||||||
_bodyEl: null,
|
_bodyEl: null,
|
||||||
|
|
||||||
|
/** @type {(() => void)|null} — called after changes are successfully committed */
|
||||||
|
_onApplied: null,
|
||||||
|
|
||||||
// ── Public API ─────────────────────────────────────────────────────────────
|
// ── Public API ─────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open the share modal for a file or folder.
|
* Open the share modal for a file or folder.
|
||||||
* @param {FileItem|FolderItem} item
|
* @param {FileItem|FolderItem} item
|
||||||
* @param {'file'|'folder'} itemType
|
* @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._item = item;
|
||||||
this._itemType = itemType;
|
this._itemType = itemType;
|
||||||
|
this._onApplied = onApplied ?? null;
|
||||||
this._localMembers = [];
|
this._localMembers = [];
|
||||||
this._localLinks = [];
|
this._localLinks = [];
|
||||||
this._newLinks = [];
|
this._newLinks = [];
|
||||||
@@ -888,6 +893,7 @@ const shareModal = {
|
|||||||
ui.setSharedVisualState(item.id, itemType, hasAnyShare);
|
ui.setSharedVisualState(item.id, itemType, hasAnyShare);
|
||||||
|
|
||||||
Modal.close(true);
|
Modal.close(true);
|
||||||
|
this._onApplied?.();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('shareModal._applyAll error:', err);
|
console.error('shareModal._applyAll error:', err);
|
||||||
if (Modal.confirmBtn) Modal.confirmBtn.disabled = false;
|
if (Modal.confirmBtn) Modal.confirmBtn.disabled = false;
|
||||||
|
|||||||
@@ -136,7 +136,11 @@ const mySharesView = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShareEdit: (resource, resourceType) => {
|
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();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user