From 015309b3dc1d125c3cf27e19cfc608e18ba680e5 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Tue, 25 Mar 2025 14:06:19 +0800 Subject: [PATCH] opt: main: anim to top Signed-off-by: bggRGjQaUbCoE --- lib/pages/main/view.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index 84344e7e..4af1ed55 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -139,12 +139,6 @@ class _MainAppState extends State } else { dynamic currentPage = _mainController.pages[value]; - if (currentPage is HomePage) { - _homeController.toTopOrRefresh(); - } else if (currentPage is DynamicsPage) { - _dynamicController.toTopOrRefresh(); - } - int now = DateTime.now().millisecondsSinceEpoch; if (now - _lastSelectTime < 500) { if (currentPage is HomePage) { @@ -152,6 +146,12 @@ class _MainAppState extends State } else if (currentPage is DynamicsPage) { _dynamicController.onRefresh(); } + } else { + if (currentPage is HomePage) { + _homeController.toTopOrRefresh(); + } else if (currentPage is DynamicsPage) { + _dynamicController.toTopOrRefresh(); + } } _lastSelectTime = now; }