fix: 修正双击点赞与心形联动

This commit is contained in:
Zhou Weidong committed 2026-10-22 22:30:01 +08:00
1 parent 78d0166eb7
commit 68ccfa21c0
8 files changed
+200 -64

No files matched your search

+5 -26
View File
@@ -516,16 +516,8 @@ class _PlayerPageState extends State<PlayerPage>
controller: videoPort?.controller,
videoUrl: videoPort?.controller.dataSource ?? episode.videoUrl,
theater: theater,
onTap: () => _handleFeedSurfaceTap(),
onTap: widget.homeMode ? () {} : _handleFeedSurfaceTap,
),
if (widget.homeMode && _chromeVisible && !logic.chromeHidden)
Positioned.fill(
child: GestureDetector(
key: const Key('home-feed-video-toggle'),
behavior: HitTestBehavior.opaque,
onTap: _handleFeedSurfaceTap,
),
),
// 票据三态之一:起播前正在向后端要签名地址
if (selected && logic.ticketLoading)
const Center(
@@ -640,24 +632,11 @@ class _PlayerPageState extends State<PlayerPage>
commentCount: _commentCounts[episode.id] ?? episode.commentCount,
saved: context.watch<FavoriteController>().isSaved(drama.id),
onLike: () async {
if (await ensureSignedIn(context)) {
if (!context.mounted) return;
unawaited(context.read<Haptics>().lightImpact());
final result = await interactions.toggleEpisodeLike(episode.id);
if (!result.isSuccess && context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
result.errorMessage ??
AppLocalizations.of(context)!.likeFailed,
),
),
);
}
}
await _toggleLike(context, interactions, episode);
},
onDoubleTapLike: (_) =>
unawaited(_likeFromDoubleTap(context, interactions, episode)),
onDoubleTapLike: (_) => unawaited(
_toggleLike(context, interactions, episode, likeOnly: true),
),
onSave: () => unawaited(_toggleSave(context, drama)),
onComments: () => unawaited(_openComments(context, drama, episode)),
onShare: () => logic.shareDrama(context, drama),