feat(simulation): optimize and persist collision viewing
This commit is contained in:
@@ -78,6 +78,12 @@ export function SimulationWorkspace() {
|
||||
setEditing(null);
|
||||
};
|
||||
|
||||
const acceptViewerProject = useCallback((project: SimulationProject) => {
|
||||
setProjects((current) => current.map((item) => (
|
||||
item.projectId === project.projectId ? project : item
|
||||
)));
|
||||
}, []);
|
||||
|
||||
const confirmDelete = async () => {
|
||||
if (!deleting) return;
|
||||
await deleteSimulationProject(deleting.projectId);
|
||||
@@ -122,7 +128,10 @@ export function SimulationWorkspace() {
|
||||
</StatusBadge>
|
||||
</header>
|
||||
{selected.status === "ready" && selected.worldManifest ? (
|
||||
<SimulationViewport project={selected} />
|
||||
<SimulationViewport
|
||||
project={selected}
|
||||
onProjectChange={acceptViewerProject}
|
||||
/>
|
||||
) : (
|
||||
<GlassSurface className="simulation-workspace__processing" padding="lg">
|
||||
{selected.status === "failed" ? <Icon name="alert" size={20} /> : <ActivityIndicator label="Сборка мира" />}
|
||||
|
||||
Reference in New Issue
Block a user