mirror of
https://github.com/xibyte/jsketcher
synced 2026-02-14 19:33:46 +01:00
set history pointer to errant operation if there is an error while modification evaluation to give a way of fixing it
This commit is contained in:
parent
778403fd19
commit
5da510578e
1 changed files with 13 additions and 4 deletions
|
|
@ -85,10 +85,19 @@ export function activate({streams, services}) {
|
|||
let {history, pointer} = curr;
|
||||
for (let i = beginIndex; i <= pointer; i++) {
|
||||
let request = history[i];
|
||||
let {consumed, created} = runOrGetPreRunResults(request);
|
||||
consumed.forEach(m => models.delete(m));
|
||||
created.forEach(m => models.add(m));
|
||||
streams.craft.models.next(Array.from(models).sort(m => m.id));
|
||||
try {
|
||||
let {consumed, created} = runOrGetPreRunResults(request);
|
||||
consumed.forEach(m => models.delete(m));
|
||||
created.forEach(m => models.add(m));
|
||||
streams.craft.models.next(Array.from(models).sort(m => m.id));
|
||||
} catch(e) {
|
||||
console.error(e);
|
||||
setTimeout(() => streams.craft.modifications.next({
|
||||
...curr,
|
||||
pointer: i-1
|
||||
}));
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue