Skip to content

Commit

Permalink
Revert "feat(designer): reset feature on test mode now resets all sub…
Browse files Browse the repository at this point in the history
…ject data that belongs to the editor."

This reverts commit 04f08ba
  • Loading branch information
ibrahimozkn committed Dec 18, 2024
1 parent a7a4f68 commit d2df698
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions app/lib/screens/app_onboarding/preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,15 @@ class Preview {
// delete study subscription and progress
if (containsQueryPair('cmd', 'reset')) {
if (selectedStudyObjectId != null) {
final List<StudySubject> subjects =
await SupabaseQuery.getAll<StudySubject>();

final List<StudySubject> subjectsToDelete = subjects
.where((subject) =>
subject.userId == Supabase.instance.client.auth.currentUser!.id,)
.toList();

subjectsToDelete.forEach((subject) async {
await subject.delete();
});
final StudySubject subject = await SupabaseQuery.getById<StudySubject>(
selectedStudyObjectId!,
selectedColumns: [
'*',
'study!study_subject_studyId_fkey(*)',
'subject_progress(*)',
],
);
subject.delete();
deleteActiveStudyReference();
selectedStudyObjectId = '';
}
Expand Down

0 comments on commit d2df698

Please sign in to comment.