Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix issue marking record state as synced

  • Loading branch information...
commit 3a4cd4950de9a08a921c32960496fda2c68fe5bd 1 parent ced74e0
@danschultz authored
Showing with 9 additions and 13 deletions.
  1. +9 −13 src/mesh/model/RecordState.as
View
22 src/mesh/model/RecordState.as
@@ -61,16 +61,12 @@ package mesh.model
public function synced():RecordState
{
- if (willBeCreated) {
- return loaded();
- }
-
- if (willBeUpdated) {
- return loaded();
- }
-
- if (willBeDestroyed) {
- return cache(DESTROY);
+ if (isBusy) {
+ if (!willBeDestroyed) {
+ return loaded();
+ } else {
+ return cache(DESTROY);
+ }
}
throw new IllegalOperationError("Record state change not defined.");
@@ -98,17 +94,17 @@ package mesh.model
public function get willBeCreated():Boolean
{
- return (value & INIT) != 0 && !isSynced;
+ return (value & INIT) != 0 && !isSynced && !isBusy;
}
public function get willBeUpdated():Boolean
{
- return (value & REMOTE) != 0 && !isSynced;
+ return (value & REMOTE) != 0 && !isSynced && !isBusy;
}
public function get willBeDestroyed():Boolean
{
- return (value & DESTROY) != 0 && !isSynced;
+ return (value & DESTROY) != 0 && !isSynced && !isBusy;
}
private var _value:int;
Please sign in to comment.
Something went wrong with that request. Please try again.