From 318bb72b642e17550be5f60ce742c73a302ecb07 Mon Sep 17 00:00:00 2001 From: otsmr Date: Sun, 25 Jan 2026 12:40:00 +0100 Subject: [PATCH] fix timing issue --- lib/src/views/user_study/user_study_data_collection.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/views/user_study/user_study_data_collection.dart b/lib/src/views/user_study/user_study_data_collection.dart index c38f213..1b576ee 100644 --- a/lib/src/views/user_study/user_study_data_collection.dart +++ b/lib/src/views/user_study/user_study_data_collection.dart @@ -4,6 +4,7 @@ import 'package:http/http.dart' as http; import 'package:twonly/globals.dart'; import 'package:twonly/src/utils/keyvalue.dart'; import 'package:twonly/src/utils/log.dart'; +import 'package:twonly/src/utils/misc.dart'; import 'package:twonly/src/utils/storage.dart'; const userStudySurveyKey = 'user_study_survey'; @@ -34,9 +35,8 @@ Future handleUserStudyUpload() async { await KeyValueStore.delete(userStudySurveyKey); } - if (gUser.lastUserStudyDataUpload - ?.isAfter(DateTime.now().subtract(const Duration(days: 1))) ?? - false) { + if (gUser.lastUserStudyDataUpload != null && + isToday(gUser.lastUserStudyDataUpload!)) { // Only send updates once a day. // This enables to see if improvements to actually work. return;