Skip to content

Commit

Permalink
fix: wait for renown to load
Browse files Browse the repository at this point in the history
  • Loading branch information
acaldas committed Apr 10, 2024
1 parent c87ee69 commit 1d2f019
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ const Root = () => {
const [searchParams, setSearchParams] = useSearchParams();

useEffect(() => {
if (!renown) {
return;
}

const userStr = searchParams.get('user');
if (userStr) {
const userDid = decodeURIComponent(userStr);
searchParams.delete('user');
setSearchParams(searchParams);
renown
?.user()
.user()
.then(user => {
if (user?.did === userDid) {
return;
Expand Down

0 comments on commit 1d2f019

Please sign in to comment.