🐛 Poll bug fixes

This commit is contained in:
2025-08-06 03:14:09 +08:00
parent 8c47a59b80
commit ccc3ac415e
2 changed files with 3 additions and 2 deletions

View File

@@ -333,7 +333,8 @@ class _PollSubmitState extends ConsumerState<PollSubmit> {
switch (q.type) {
case SnPollQuestionType.rating:
// rating: avg score (double or int)
final avg = (raw['rating'] as num).toDouble();
final avg = (raw['rating'] as num?)?.toDouble();
if (avg == null) break;
final theme = Theme.of(context);
body = Row(
mainAxisAlignment: MainAxisAlignment.start,

View File

@@ -571,7 +571,7 @@ class PostItem extends HookConsumerWidget {
onSubmit: (_) {},
).padding(horizontal: 16, vertical: 12),
),
_ => const Placeholder(),
_ => Text('Unable show embed: ${embedData['type']}'),
},
)),
if (isShowReference)