UI: Avoid redundant URL completion in CollectionsScene
**Problem Description:** Redundant URL completion in `CollectionsScene.js`. The file passes a `collection.href` that already contains the full path prefix to `UrlTextHandler.setHref`. Because `setHref` internally calls `completeHref` again, the path is double-completed (over-completed), resulting in a malformed URL. **Solution:** Instead of using `completeHref(collection.href)`, use `window.location.origin + collection.href` to manually construct the full URL, preventing the secondary completion bug.
This commit is contained in:
@@ -268,7 +268,7 @@ export class CollectionsScene {
|
||||
}
|
||||
contentcount_form.textContent = contentcount_form_txt;
|
||||
}
|
||||
let href = completeHref(collection.href);
|
||||
let href = window.location.origin + collection.href;
|
||||
new UrlTextHandler(url_form, copy_btn).setHref(href);
|
||||
download_btn.href = href;
|
||||
download_btn.onclick = (event) => {
|
||||
@@ -361,4 +361,4 @@ export class CollectionsScene {
|
||||
return this._principal_collection.displayname;
|
||||
else return this._user;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user