From 0c0dfc6fbe568030787bb7f023997b831fb2fc14 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sat, 11 Jan 2025 09:42:08 +0800 Subject: [PATCH] opt: manual skip Signed-off-by: bggRGjQaUbCoE --- lib/pages/video/detail/controller.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index d23aff4e..6b246b3e 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -857,9 +857,6 @@ class VideoDetailController extends GetxController skipTimer ??= Timer.periodic(const Duration(seconds: 4), (_) { if (listData.isNotEmpty) { onRemoveItem(listData.length - 1, listData.last); - } else { - skipTimer?.cancel(); - skipTimer = null; } }); } @@ -869,6 +866,10 @@ class VideoDetailController extends GetxController () { try { listData.removeAt(index); + if (listData.isEmpty) { + skipTimer?.cancel(); + skipTimer = null; + } listKey.currentState?.removeItem( index, (context, animation) => buildItem(item, animation),