Skip to content

Commit

Permalink
Change starting and stoping observing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Brano5 committed Aug 16, 2023
1 parent cd2c5b6 commit 8f55cc1
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,13 @@ public IBrowsableDataObject SelectedRecord

set
{
DataExchange.ChangeTrackerStopObservingChanges();

_selectedRecord = value;
if (value != null)
{
DataExchange.FromRepositoryToShadowsAsync(value);
DataExchange.ChangeTrackerSetChanges(value);
Changes = DataExchange.ChangeTrackerGetChanges().OrderBy(p => p.DateTime.Ticks).ToList();
}

DataExchange.ChangeTrackerStartObservingChanges(Asp.GetAuthenticationStateAsync().Result);
}
}

Expand All @@ -78,13 +74,15 @@ public void Locked()
if (IsLockedByMeOrNull())
{
DataExchange.SetLockedBy(this);
DataExchange.ChangeTrackerStartObservingChanges(Asp.GetAuthenticationStateAsync().Result);
}
}

public void UnLocked()
{
if (IsLockedByMeOrNull())
{
DataExchange.ChangeTrackerStopObservingChanges();
DataExchange.SetLockedBy(null);
}
}
Expand Down

0 comments on commit 8f55cc1

Please sign in to comment.