Skip to content

Commit 59ef5e5

Browse files
committed
chore: rename fromDashboard
1 parent 5bf8c14 commit 59ef5e5

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

web-marketplace/src/legacy-pages/ProjectAccount/ProjectAccount.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const ProjectAccount = (): JSX.Element | null => {
3030
const { projectId } = useParams();
3131
const [searchParams] = useSearchParams();
3232
const fromPath = searchParams.get('from');
33-
const fromDashboard = !!fromPath;
33+
const hasOriginPath = !!fromPath;
3434
const isOrganizationParam = searchParams.get('isOrganization') === 'true';
3535
const { activeAccount } = useAuth();
3636
const dao = useDaoOrganization();
@@ -79,7 +79,7 @@ export const ProjectAccount = (): JSX.Element | null => {
7979
const shouldSkip =
8080
!dao || !activeAccount || !personalAccount || !organizationAccount;
8181

82-
// Track if we've initialized from dashboard state
82+
// Track if we've initialized from origin path state
8383
const initializedRef = useRef(false);
8484
const [isStateReady, setIsStateReady] = useState(false);
8585

@@ -88,8 +88,8 @@ export const ProjectAccount = (): JSX.Element | null => {
8888
// Don't run if we've already initialized or accounts aren't ready
8989
if (initializedRef.current) return;
9090

91-
if (fromDashboard) {
92-
// Coming from dashboard - use the passed params
91+
if (hasOriginPath) {
92+
// Coming from an origin path - use the passed params
9393
const isOrg = isOrganizationParam;
9494
const address = isOrg
9595
? organizationAccount?.address
@@ -116,7 +116,7 @@ export const ProjectAccount = (): JSX.Element | null => {
116116
setIsStateReady(true);
117117
}
118118
}, [
119-
fromDashboard,
119+
hasOriginPath,
120120
isOrganizationParam,
121121
organizationAccount?.address,
122122
personalAccount?.address,
@@ -142,27 +142,27 @@ export const ProjectAccount = (): JSX.Element | null => {
142142

143143
// Navigate away if user should skip this step, but only after:
144144
// 1. Issuer check completes
145-
// 2. State is properly initialized (for dashboard redirects)
145+
// 2. State is properly initialized (for origin path redirects)
146146
useEffect(() => {
147147
const canNavigate =
148-
!isLoadingIsIssuer && (shouldSkip || (fromDashboard && isStateReady));
148+
!isLoadingIsIssuer && (shouldSkip || (hasOriginPath && isStateReady));
149149
if (canNavigate) {
150150
navigateNext();
151151
}
152152
}, [
153153
shouldSkip,
154154
isLoadingIsIssuer,
155155
navigateNext,
156-
fromDashboard,
156+
hasOriginPath,
157157
isStateReady,
158158
]);
159159

160160
// Show loading while:
161161
// 1. Checking issuer status
162-
// 2. Processing dashboard redirect (waiting for state to be ready)
162+
// 2. Processing origin path redirect (waiting for state to be ready)
163163
// 3. User should skip this page
164164
const showLoading =
165-
isLoadingIsIssuer || (fromDashboard && !isStateReady) || shouldSkip;
165+
isLoadingIsIssuer || (hasOriginPath && !isStateReady) || shouldSkip;
166166

167167
if (showLoading) {
168168
return (

web-marketplace/src/legacy-pages/ProjectCreate/ProjectCreate.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ export const ProjectCreate = (): JSX.Element => {
113113
const fromState =
114114
(location.state as { from?: string } | null)?.from ?? null;
115115
const fromParam = new URLSearchParams(location.search).get('from');
116-
const safeFromParam = fromParam && isSafeRelativePath(fromParam) ? fromParam : null;
116+
const safeFromParam =
117+
fromParam && isSafeRelativePath(fromParam) ? fromParam : null;
117118
originPathRef.current = fromState ?? safeFromParam;
118119
}
119120
// eslint-disable-next-line react-hooks/exhaustive-deps

0 commit comments

Comments
 (0)