Skip to content

Commit

Permalink
NCL-8833 Change UI-Logger to console log for LegacyUrlRedirector
Browse files Browse the repository at this point in the history
  • Loading branch information
DnsZhou committed Nov 18, 2024
1 parent 98e589a commit 7bee175
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/hooks/useLegacyUrlRedirector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ import { useEffect } from 'react';

import { URL_BASE_PATH } from 'common/constants';

import { uiLogger } from 'services/uiLogger';

export const useLegacyUrlRedirector = () => {
useEffect(() => {
const { pathname, hash } = window.location;
const oldUrl = window.location;

if (pathname.startsWith(URL_BASE_PATH + '/') && hash.startsWith('#/')) {
let newPath = '/' + hash.substring(2); // Remove '#/' and concatenate
Expand All @@ -24,7 +21,7 @@ export const useLegacyUrlRedirector = () => {
newPath = newPath.substring(buildsIndex);
}

uiLogger.log(`Redirecting to new URL: ${newPath}`, undefined, { oldUrl, newUrl: newPath });
console.log(`Redirecting to new URL: ${newPath}`);
window.location.href = URL_BASE_PATH + newPath;
}
}, []);
Expand Down

0 comments on commit 7bee175

Please sign in to comment.