Merge pull request #4053 from sbwalker/dev
optimize SiteRouter to only call SyncService for Interactive render mode
This commit is contained in:
commit
6e7ce10585
|
@ -163,33 +163,24 @@
|
||||||
visitorId = PageState.VisitorId;
|
visitorId = PageState.VisitorId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// process any sync events
|
if (PageState.RenderMode == RenderModes.Interactive)
|
||||||
var sync = await SyncService.GetSyncEventsAsync(lastsyncdate);
|
|
||||||
lastsyncdate = sync.SyncDate;
|
|
||||||
if (sync.SyncEvents.Any())
|
|
||||||
{
|
{
|
||||||
// reload client application if server was restarted
|
// process any sync events (for synchrozing the client application with the server)
|
||||||
if (sync.SyncEvents.Exists(item => item.Action == SyncEventActions.Reload && item.EntityName == EntityNames.Host))
|
var sync = await SyncService.GetSyncEventsAsync(lastsyncdate);
|
||||||
|
lastsyncdate = sync.SyncDate;
|
||||||
|
if (sync.SyncEvents.Any())
|
||||||
{
|
{
|
||||||
NavigationManager.NavigateTo(_absoluteUri, true);
|
// reload client application if server was restarted
|
||||||
return;
|
if (sync.SyncEvents.Exists(item => item.Action == SyncEventActions.Reload && item.EntityName == EntityNames.Host))
|
||||||
}
|
{
|
||||||
// reload client application if site runtime/rendermode was modified
|
NavigationManager.NavigateTo(_absoluteUri, true);
|
||||||
if (sync.SyncEvents.Exists(item => item.Action == SyncEventActions.Reload && item.EntityName == EntityNames.Site && item.EntityId == SiteState.Alias.SiteId))
|
return;
|
||||||
{
|
}
|
||||||
NavigationManager.NavigateTo(_absoluteUri, true);
|
// refresh PageState when site information has changed
|
||||||
return;
|
if (sync.SyncEvents.Exists(item => item.Action == SyncEventActions.Refresh && item.EntityName == EntityNames.Site && item.EntityId == SiteState.Alias.SiteId))
|
||||||
}
|
{
|
||||||
// reload client application if current user auth information has changed
|
refresh = true;
|
||||||
if (user != null && sync.SyncEvents.Exists(item => item.Action == SyncEventActions.Reload && item.EntityName == EntityNames.User && item.EntityId == user.UserId))
|
}
|
||||||
{
|
|
||||||
NavigationManager.NavigateTo(_absoluteUri, true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// refresh PageState when site information has changed
|
|
||||||
if (sync.SyncEvents.Exists(item => item.Action == SyncEventActions.Refresh && item.EntityName == EntityNames.Site && item.EntityId == SiteState.Alias.SiteId))
|
|
||||||
{
|
|
||||||
refresh = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user