fix: share dialog not opening + connect to backend API

- Fix showShareDialog: add try-catch, null checks, prevent textContent
  from destroying header icon (use span child instead)
- Capture file/folder target before closeContextMenu to prevent race
- createSharedLink now calls real backend POST /api/shares instead of
  localStorage-only mock (still caches locally for offline compat)
- Fix share_handler.rs: use OptionalAuthUser instead of AuthUser to
  prevent 401 when auth is disabled (same pattern as delete/trash)
- Add null-safety to closeShareDialog
- Reset new-share-section on dialog open
This commit is contained in:
Dionisio
2026-02-13 12:29:21 +01:00
parent 1dec88eb59
commit ea234bc6a1
4 changed files with 112 additions and 53 deletions
+2 -2
View File
@@ -204,8 +204,8 @@ const ui = {
contextMenus.closeShareDialog();
});
document.getElementById('share-confirm-btn').addEventListener('click', () => {
contextMenus.createSharedLink();
document.getElementById('share-confirm-btn').addEventListener('click', async () => {
await contextMenus.createSharedLink();
});
document.getElementById('copy-share-btn').addEventListener('click', async () => {