1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-12-16 01:10:30 +02:00

Fix redirection when returning from new website (#5527)

This commit is contained in:
Álvaro Mondéjar 2021-04-23 13:07:50 +02:00 committed by GitHub
parent 2fb218a989
commit 07e57ebaff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -200,6 +200,7 @@
$hideAlways = document.getElementById('hide-feedback-request');
var redesignUrl = 'https://simple-icons.github.io/simple-icons-website/',
redesignRootDomain = 'simple-icons.github.io',
hideBannerAlwaysIdentifier = 'hide-banner',
redirectAutomaticallyIdentifier = 'redirect-to-redesign';
@ -235,7 +236,7 @@
var redirect = localStorage.getItem(redirectAutomaticallyIdentifier);
if (redirect === 'true') {
$redirectAutomatically.innerHTML = "Disable redirect";
if (document.referrer !== redesignUrl) {
if (document.referrer.split('/')[2] !== redesignRootDomain) {
window.location.replace(redesignUrl);
}
}