Skip to content
Snippets Groups Projects
Commit 6bf143fd authored by Maxime's avatar Maxime
Browse files

bugfix: uncomment url block in js #269

parent 89717aac
No related branches found
No related tags found
1 merge request!265Q-a fixes - batch 1
Pipeline #9523 failed with stage
in 1 hour
......@@ -74,27 +74,27 @@ class CoopStarterLoginComponent extends HTMLElement {
}
}
}
//If the url asked pointed to a resource
/* if (window.location.href.indexOf('resource-detail') > -1) {
var newUrl = window.location.href.replace(/\/([a-z]+)-dashboard\/([a-z]+)-resource-detail/, `/${userPrefix}-dashboard/${userPrefix}-resource-detail`)
//If the url asked pointed to a resource
if (window.location.href.indexOf('resource-detail') > -1) {
var newUrl = window.location.href.replace(/\/([a-z]+)-dashboard\/([a-z]+)-resource-detail/, `/${userPrefix}-dashboard/${userPrefix}-resource-detail`)
// If the url is different after the treatment, we reload with the good url
if (newUrl !== window.location.href) {
var newRoute = new URL(newUrl).pathname.replace(/^\/([a-z]{2})\//, "");
window.dispatchEvent(
new CustomEvent('requestNavigation', {
detail: {
route: newRoute.split(/\/(.*?)\//)[1],
resource: { "@id": this.decodeId(newRoute.split(/@(.+)/)[1]) }
}
})
);
window.location.href = newUrl;
// loader.toggleAttribute('hidden', true);
} else {
loader.toggleAttribute('hidden', true);
}
} else {*/
// If the url is different after the treatment, we reload with the good url
if (newUrl !== window.location.href) {
var newRoute = new URL(newUrl).pathname.replace(/^\/([a-z]{2})\//, "");
window.dispatchEvent(
new CustomEvent('requestNavigation', {
detail: {
route: newRoute.split(/\/(.*?)\//)[1],
resource: { "@id": this.decodeId(newRoute.split(/@(.+)/)[1]) }
}
})
);
window.location.href = newUrl;
// loader.toggleAttribute('hidden', true);
} else {
loader.toggleAttribute('hidden', true);
}
} else {
// User is a contributor
if (userPrefix === "contributor") {
loader.toggleAttribute('hidden', true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment