Skip to content

Commit

Permalink
refactor: remove unused useeffect flow
Browse files Browse the repository at this point in the history
Co-authored-by: Arthur Geron <3487334+arthurgeron@users.noreply.github.com>
  • Loading branch information
helciofranco and arthurgeron authored Jan 14, 2025
1 parent caa0e83 commit e91c345
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/app/src/systems/DApp/hooks/useOrigin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,5 @@ const parseUrl = (url: string): Origin | undefined => {
};

export const useOrigin = ({ url }: UseOriginProps) => {
const [origin, setOrigin] = useState<Origin | undefined>();

useEffect(() => {
if (!url) return;
const origin = parseUrl(url);
setOrigin(origin);
}, [url]);

return origin;
return useMemo(() => url ? parseUrl(url) : undefined, [url]);
};

0 comments on commit e91c345

Please sign in to comment.