自习数据采样优化
This commit is contained in:
lincube
2026-03-07 22:44:00 +08:00
parent 435b96c50c
commit 3aee31c6c0
5 changed files with 102 additions and 13 deletions

View File

@@ -64,8 +64,16 @@ public partial class StudyEnvironmentWidget : UserControl, IDesktopComponentWidg
public void SetDesktopPageContext(bool isOnActivePage, bool isEditMode)
{
_ = isEditMode;
var wasOnActivePage = _isOnActivePage;
_isOnActivePage = isOnActivePage;
UpdateMonitoringLeaseState();
if (isOnActivePage && !wasOnActivePage)
{
RefreshVisual();
}
UpdateTimerState();
}
@@ -116,8 +124,7 @@ public partial class StudyEnvironmentWidget : UserControl, IDesktopComponentWidg
private void UpdateMonitoringLeaseState()
{
var shouldMonitor = _isAttached && _isOnActivePage;
if (shouldMonitor)
if (_isAttached)
{
_monitoringLease ??= _monitoringLeaseCoordinator.AcquireLease();
return;