diff --git a/src/App.tsx b/src/App.tsx index da1af89..fb52216 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -35,7 +35,7 @@ import { NotificationsToastArea } from '@/layout/NotificationsToastArea'; import { DialogManager } from '@/layout/DialogManager'; import { GlobalCommandDialog } from '@/views/dialogs/GlobalCommandDialog'; -import { parseHash } from '@/lib/urlUtils'; +import { parseLocationHash } from '@/lib/urlUtils'; import { config } from '@/lib/wagmi'; import { breakpoints } from '@/styles'; @@ -75,7 +75,7 @@ const Content = () => { if (location.hash === '') { return ''; } - return parseHash(location.hash); + return parseLocationHash(location.hash); }, [location.hash]); return ( diff --git a/src/lib/__test__/urlUtils.spec.ts b/src/lib/__test__/urlUtils.spec.ts index aaee71a..40ad600 100644 --- a/src/lib/__test__/urlUtils.spec.ts +++ b/src/lib/__test__/urlUtils.spec.ts @@ -1,14 +1,14 @@ import { describe, expect, it } from 'vitest'; -import { parseHash } from '@/lib/urlUtils'; +import { parseLocationHash } from '@/lib/urlUtils'; -describe('parseHash', () => { +describe('parseLocationHash', () => { it('returns the path separated from hash', () => { const hash = '#/markets'; - expect(parseHash(hash)).toEqual('/markets'); + expect(parseLocationHash(hash)).toEqual('/markets'); }); it('returns the path and query string separated from hash', () => { const hash = '#/markets?displayinitializingmarkets=true'; - expect(parseHash(hash)).toEqual('/markets?displayinitializingmarkets=true'); + expect(parseLocationHash(hash)).toEqual('/markets?displayinitializingmarkets=true'); }); }); diff --git a/src/lib/urlUtils.ts b/src/lib/urlUtils.ts index 39015f6..be5694e 100644 --- a/src/lib/urlUtils.ts +++ b/src/lib/urlUtils.ts @@ -2,7 +2,7 @@ * @param hash location.hash * @returns path and query string if hash parameter is not empty */ -export const parseHash = (hash: string) => { +export const parseLocationHash = (hash: string) => { if (!hash || hash.length === 0) return ''; // Remove '#' and split by '?'