refactor(editor): applyRepair within the locals limit
This commit is contained in:
1 parent
9c21fd3f86
commit
46fd861224
1 file changed
+4
-2
@@ -308,8 +308,10 @@ export function applyRepair(
|
|||||||
): RepairResult {
|
): RepairResult {
|
||||||
const store = useEditorStore.getState()
|
const store = useEditorStore.getState()
|
||||||
const before = store.previewState
|
const before = store.previewState
|
||||||
const live = before !== null && store.session === offer.session
|
const batch =
|
||||||
const batch = live ? repairBatch(offer, before, geometries) : null
|
before && store.session === offer.session
|
||||||
|
? repairBatch(offer, before, geometries)
|
||||||
|
: null
|
||||||
if (!before || !batch) return blockedResult(context)
|
if (!before || !batch) return blockedResult(context)
|
||||||
const accept = repairAccept(before, offer.assetId, batch.ids)
|
const accept = repairAccept(before, offer.assetId, batch.ids)
|
||||||
const outcome = store.commitBatch(batch.commands, { accept })
|
const outcome = store.commitBatch(batch.commands, { accept })
|
||||||
|
|||||||
Reference in new issue
Block a user