Skip to content

Commit 780f5be

Browse files
committed
Fix resource.new not changed back after save error #1077
1 parent 86320dd commit 780f5be

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

browser/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This changelog covers all five packages, as they are (for now) updated as a whol
2727
- SEMI BREAKING CHANGE: When using generated types by cli, @tomic/lib now requires them to be generated by @tomic/cli v0.41.0 or above.
2828
- Fix types masquerading as esm module in cjs build.
2929
- `store.search()` now handles multiple values for the same property correctly.
30+
- [#1077](https://github.com/atomicdata-dev/atomic-server/issues/1077) Fix bug where resource.new would not be set back to true when saving fails.
3031

3132
### @tomic/react
3233

browser/lib/src/resource.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ export class Resource<C extends OptionalClass = any> {
737737
// If it fails, revert to the old resource with the old CommitBuilder
738738
this.commitBuilder = oldCommitBuilder;
739739
this.commitError = e;
740+
this.new = wasNew;
740741
this.store.addResources(this, { skipCommitCompare: true });
741742
reportDone();
742743
throw e;

0 commit comments

Comments
 (0)