Skip to content

Commit

Permalink
remove 'lods' step on deployment for worlds
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoecheza committed Feb 4, 2025
1 parent 1c9a811 commit 7cdc0dc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,13 @@ type DeployingProps = {

function Deploying({ info, url, onSuccess, onClick, onRetry }: DeployingProps) {
const { wallet } = useAuth();
const [deployState, setDeployState] = useState<DeploymentStatus>(getInitialDeploymentStatus());
const [deployState, setDeployState] = useState<DeploymentStatus>(getInitialDeploymentStatus(info.isWorld));

const getDeploymentStatus = useCallback((): Promise<DeploymentStatus> => {
if (!wallet) throw new Error('No wallet provided');
const identity = localStorageGetIdentity(wallet);
if (!identity) throw new Error(`No identity found for wallet ${wallet}`);
return fetchDeploymentStatus(info.rootCID, identity);
return fetchDeploymentStatus(info.rootCID, identity, info.isWorld);
}, [wallet, info]);

const onReportIssue = useCallback(() => {
Expand Down Expand Up @@ -482,7 +482,7 @@ function Deploying({ info, url, onSuccess, onClick, onRetry }: DeployingProps) {

const steps: Step[] = useMemo(() => {
const { catalyst, assetBundle, lods } = deployState;
return [
const baseSteps = [
{
bulletText: '1',
name: t('modal.publish_project.deploy.deploying.step.catalyst'),
Expand All @@ -495,14 +495,20 @@ function Deploying({ info, url, onSuccess, onClick, onRetry }: DeployingProps) {
description: getStepDescription(assetBundle),
state: assetBundle,
},
{
];

// Only add LODs step for non-world deployments
if (!info.isWorld) {
baseSteps.push({
bulletText: '3',
name: t('modal.publish_project.deploy.deploying.step.lods'),
description: getStepDescription(lods),
state: lods,
},
];
}, [deployState, getStepDescription]);
});
}

return baseSteps;
}, [deployState, getStepDescription, info.isWorld]);

const isFinishing = useMemo(() => isDeployFinishing(deployState), [deployState]);
const overallStatus = useMemo(() => deriveOverallStatus(deployState), [deployState]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import {
DeploymentError,
} from './types';

export const getInitialDeploymentStatus = (): DeploymentStatus => ({
export const getInitialDeploymentStatus = (isWorld: boolean = false): DeploymentStatus => ({
catalyst: 'idle',
assetBundle: 'idle',
lods: 'idle',
lods: isWorld ? 'complete' : 'idle', // Auto-complete for worlds
});

export const retryDelayInMs = seconds(10);
Expand Down Expand Up @@ -102,6 +102,7 @@ export function cleanPendingsFromDeploymentStatus(status: DeploymentStatus): Dep
export async function fetchDeploymentStatus(
sceneId: string,
identity: AuthIdentity,
isWorld: boolean = false,
): Promise<DeploymentStatus> {
const method = 'get';
const path = `/entities/status/${sceneId}`;
Expand All @@ -119,7 +120,7 @@ export async function fetchDeploymentStatus(
return {
catalyst: validateStatus(json.catalyst),
assetBundle: deriveOverallStatus(json.assetBundles),
lods: deriveOverallStatus(json.lods),
lods: isWorld ? 'complete' : deriveOverallStatus(json.lods), // Skip lods for worlds
};
}

Expand Down

0 comments on commit 7cdc0dc

Please sign in to comment.