Handle zero opponent IDs and hide video button

This commit is contained in:
2026-07-20 10:23:44 +08:00
parent e5b6246458
commit da52dc9797
2 changed files with 24 additions and 24 deletions
@@ -90,7 +90,7 @@ Widget buildEventRegistrationDestination({
required EventRegistrationItem item,
required String playerId,
}) {
if (item.opponentId.isNotEmpty) {
if (item.opponentId.isNotEmpty && item.opponentId != '0') {
return EventTeamMatchPage(item: item, playerId: playerId);
}
return WebviewPage(
@@ -81,29 +81,29 @@ class _AuthPageWidgetState extends ConsumerState<ScanQrCodePage> {
),
SizedBox(height: 20.h),
Consumer(
builder: (context, ref, child) {
return SizedBox(
width: 280.w,
height: 80.h,
child: AppButton(
label: '查看录像',
onPressed: () async {
final data = ref.watch(
authProvider.select((state) => state.jwtDecodedData),
);
if (data == null) return;
debugPrint('赛事名字: ${data.eventName}');
final eventName = data.eventName ?? '';
await ref
.read(authProvider.notifier)
.getRecordList(eventName);
},
variant: AppButtonVariant.secondary,
),
);
},
),
// Consumer(
// builder: (context, ref, child) {
// return SizedBox(
// width: 280.w,
// height: 80.h,
// child: AppButton(
// label: '查看录像',
// onPressed: () async {
// final data = ref.watch(
// authProvider.select((state) => state.jwtDecodedData),
// );
// if (data == null) return;
// debugPrint('赛事名字: ${data.eventName}');
// final eventName = data.eventName ?? '';
// await ref
// .read(authProvider.notifier)
// .getRecordList(eventName);
// },
// variant: AppButtonVariant.secondary,
// ),
// );
// },
// ),
SizedBox(height: 16.h),
Consumer(