fix: image refs in description and broken gallery URLs
- EditDrawer: stop auto-inserting  into description on
upload — images are tracked via custom.images; the refs only cluttered
the textarea. Strip any pre-existing refs on load so old sidecars are
also cleaned up when the drawer is opened.
- ActivityDetail: imageBase now treats detail_url that starts with '/'
as already-absolute (same fix pattern as track_url / detail_url);
was prepending ${base}data/ on top of /data/... → double path.
This commit is contained in:
@@ -82,10 +82,11 @@
|
||||
})();
|
||||
|
||||
// Derive image dir from detail_url so multi-user paths resolve correctly.
|
||||
// "dave/_merged/activities/foo.json" → "/data/dave/_merged/activities/images/{id}/"
|
||||
// Relative: "dave/_merged/activities/foo.json" → "/data/dave/_merged/activities/images/{id}/"
|
||||
// Absolute: "/data/dave/_merged/activities/foo.json" → "/data/dave/_merged/activities/images/{id}/"
|
||||
$: imageBase = (() => {
|
||||
const du = activity.detail_url ?? '';
|
||||
const dir = du.startsWith('http')
|
||||
const dir = du.startsWith('http') || du.startsWith('/')
|
||||
? du.substring(0, du.lastIndexOf('/') + 1)
|
||||
: du.includes('/')
|
||||
? `${base}data/${du.substring(0, du.lastIndexOf('/') + 1)}`
|
||||
|
||||
Reference in New Issue
Block a user