(newName)
| 624 | |
| 625 | // Use the same preview endpoint, just swap the "file" param. |
| 626 | function siblingPreviewUrl(newName) { |
| 627 | try { |
| 628 | const u = new URL(baseUrl, window.location.origin); |
| 629 | u.searchParams.set('file', newName); |
| 630 | // cache-bust so we don’t get stale frames |
| 631 | u.searchParams.set('t', String(Date.now())); |
| 632 | return u.toString(); |
| 633 | } catch (e) { |
| 634 | // Fallback: go through generic download/inline endpoint |
| 635 | return buildPreviewUrl(folder, newName); |
| 636 | } |
| 637 | } |
| 638 | |
| 639 | setTitle(overlay, name); |
| 640 | if (isSvg) { |
no test coverage detected