🐛 Dozens of bug fixes

This commit is contained in:
2025-08-06 18:15:13 +08:00
parent b31a915544
commit fff43de9e3
3 changed files with 9 additions and 3 deletions

View File

@@ -218,6 +218,11 @@ class ExploreScreen extends HookConsumerWidget {
right: 12, right: 12,
top: 16, top: 16,
), ),
onChecked: () {
ref.invalidate(
eventCalendarProvider(query.value),
);
},
), ),
Card( Card(
margin: EdgeInsets.only(left: 8, right: 12, top: 8), margin: EdgeInsets.only(left: 8, right: 12, top: 8),

View File

@@ -36,7 +36,8 @@ Future<SnCheckInResult?> checkInResultToday(Ref ref) async {
class CheckInWidget extends HookConsumerWidget { class CheckInWidget extends HookConsumerWidget {
final EdgeInsets? margin; final EdgeInsets? margin;
const CheckInWidget({super.key, this.margin}); final VoidCallback? onChecked;
const CheckInWidget({super.key, this.margin, this.onChecked});
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
@@ -52,6 +53,7 @@ class CheckInWidget extends HookConsumerWidget {
ref.invalidate(checkInResultTodayProvider); ref.invalidate(checkInResultTodayProvider);
final userNotifier = ref.read(userInfoProvider.notifier); final userNotifier = ref.read(userInfoProvider.notifier);
userNotifier.fetchUser(); userNotifier.fetchUser();
onChecked?.call();
} catch (err) { } catch (err) {
if (err is DioException) { if (err is DioException) {
if (err.response?.statusCode == 423 && context.mounted) { if (err.response?.statusCode == 423 && context.mounted) {

View File

@@ -772,7 +772,7 @@ class PostReplyPreview extends HookConsumerWidget {
final posts = useState<List<SnPost>>([]); final posts = useState<List<SnPost>>([]);
final loading = useState(false); final loading = useState(false);
Future<void> fetchMoreReplies({int pageSize = 1}) async { Future<void> fetchMoreReplies({int pageSize = 3}) async {
final client = ref.read(apiClientProvider); final client = ref.read(apiClientProvider);
loading.value = true; loading.value = true;
@@ -943,7 +943,6 @@ class PostReplyPreview extends HookConsumerWidget {
children: [ children: [
Text('repliesCount') Text('repliesCount')
.plural(parent.repliesCount) .plural(parent.repliesCount)
.tr()
.fontSize(15) .fontSize(15)
.bold() .bold()
.padding(horizontal: 5), .padding(horizontal: 5),