Skip to content

Commit

Permalink
fix: Save project (#3055)
Browse files Browse the repository at this point in the history
* fix: Increase materials limit for templates

* fix: save project
  • Loading branch information
cyaiox authored Mar 4, 2024
1 parent 4e477fe commit c04dcbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/modules/scene/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ const baseSceneReducer = (state: SceneState = INITIAL_STATE, action: SceneReduce
sdk7: {
...scene.sdk7,
metrics,
limits,
limits: {
...limits,
// INCREASE MATERIALS LIMIT FOR TEMPLATES
materials: limits.materials * 1.1
},
entitiesOutOfBoundaries
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/modules/sync/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function* syncSaga(builder: BuilderAPI) {

try {
yield call(() => saveProject(project.id, project, scene, builder, debounce))

yield put(saveProjectSuccess(project))
if (scene.sdk7) {
const iframe = document.getElementById('inspector') as HTMLIFrameElement | null
if (!iframe || !iframe.contentWindow!) return
Expand All @@ -95,8 +95,6 @@ export function* syncSaga(builder: BuilderAPI) {
const entitiesOutOfBoundaries: number = yield call(sceneMetrics.getEntitiesOutOfBoundaries)
yield put(updateMetrics(scene.sdk7.id, metrics, limits, entitiesOutOfBoundaries))
}

yield put(saveProjectSuccess(project))
} catch (e) {
yield put(saveProjectFailure(project, isErrorWithMessage(e) ? e.message : 'Unknown error'))
}
Expand Down

0 comments on commit c04dcbb

Please sign in to comment.