From 1bd244011f8b301c2114179e40388a1c5be05b85 Mon Sep 17 00:00:00 2001 From: William Jordan-Cooley Date: Wed, 9 Oct 2024 11:19:07 -0400 Subject: [PATCH] remove use of record --- .../practice_activity_card.dart | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/pangea/widgets/practice_activity/practice_activity_card.dart b/lib/pangea/widgets/practice_activity/practice_activity_card.dart index 517cbcebe..8e849a6f0 100644 --- a/lib/pangea/widgets/practice_activity/practice_activity_card.dart +++ b/lib/pangea/widgets/practice_activity/practice_activity_card.dart @@ -93,24 +93,24 @@ class MessagePracticeActivityCardState extends State { /// If not, get a new activity from the server. Future initialize() async { _setPracticeActivity( - _fetchExistingIncompleteActivity() ?? await _fetchNewActivity(), + await _fetchNewActivity(), ); } // if the user did the activity before but awhile ago and we don't have any // more target tokens, maybe we should give them the same activity again - PracticeActivityEvent? _fetchExistingIncompleteActivity() { - if (practiceActivities.isEmpty) { - return null; - } + // PracticeActivityEvent? _fetchExistingIncompleteActivity() { + // if (practiceActivities.isEmpty) { + // return null; + // } - final List incompleteActivities = - practiceActivities.where((element) => !element.isComplete).toList(); + // final List incompleteActivities = + // practiceActivities.where((element) => !element.isComplete).toList(); - // TODO - maybe check the user's xp for the tgtConstructs and decide if its relevant for them - // however, maybe we'd like to go ahead and give them the activity to get some data on our xp? - return incompleteActivities.firstOrNull; - } + // // TODO - maybe check the user's xp for the tgtConstructs and decide if its relevant for them + // // however, maybe we'd like to go ahead and give them the activity to get some data on our xp? + // return incompleteActivities.firstOrNull; + // } Future _fetchNewActivity([ ActivityQualityFeedback? activityFeedback, @@ -213,19 +213,19 @@ class MessagePracticeActivityCardState extends State { // save the record without awaiting to avoid blocking the UI // send a copy of the activity record to make sure its not overwritten by // the new activity - MatrixState.pangeaController.activityRecordController - .send(currentCompletionRecord!, currentActivity!) - .catchError( - (e, s) => ErrorHandler.logError( - e: e, - s: s, - m: 'Failed to save record', - data: { - 'record': currentCompletionRecord?.toJson(), - 'activity': currentActivity?.practiceActivity.toJson(), - }, - ), - ); + // MatrixState.pangeaController.activityRecordController + // .send(currentCompletionRecord!, currentActivity!) + // .catchError( + // (e, s) => ErrorHandler.logError( + // e: e, + // s: s, + // m: 'Failed to save record', + // data: { + // 'record': currentCompletionRecord?.toJson(), + // 'activity': currentActivity?.practiceActivity.toJson(), + // }, + // ), + // ); widget.overlayController.onActivityFinish();