Skip to content

Commit

Permalink
small improvements to informed consent page
Browse files Browse the repository at this point in the history
  • Loading branch information
bardram committed Jan 29, 2024
1 parent 8aca891 commit 2f08e0e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
10 changes: 4 additions & 6 deletions lib/ui/pages/informed_consent_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class InformedConsentState extends State<InformedConsentPage> {
key: _scaffoldKey,
body: FutureBuilder<RPOrderedTask?>(
future: widget.model.getInformedConsent(localization.locale).then(
(value) {
if (value == null) {
(document) {
if (document == null) {
bloc.hasInformedConsentBeenAccepted = true;
context.go('/');
}
return value;
return document;
},
),
builder: (context, snapshot) {
Expand All @@ -45,9 +45,7 @@ class InformedConsentState extends State<InformedConsentPage> {
}
}

return const Center(
child: CircularProgressIndicator(),
);
return const Center(child: CircularProgressIndicator());
},
),
);
Expand Down
2 changes: 0 additions & 2 deletions lib/view_models/device_view_models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,5 @@ class DeviceViewModel extends ViewModel {
warning(
"$runtimeType - Error disconnecting to device '${deviceManager.id}' - $error.");
}

// deviceManager.status = DeviceStatus.disconnected; // Force status update
}
}
6 changes: 4 additions & 2 deletions lib/view_models/informed_consent_page_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class InformedConsentViewModel extends ViewModel {
/// Get the informed consent for this study as translated to the
/// local [locale].
Future<RPOrderedTask?> getInformedConsent(Locale locale) async {
await bloc.localizationLoader.load(locale);
_informedConsent ??= await bloc.informedConsentManager.getInformedConsent();
if (_informedConsent == null) {
await bloc.localizationLoader.load(locale);
_informedConsent = await bloc.informedConsentManager.getInformedConsent();
}
return _informedConsent;
}

Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ packages:
dependency: "direct main"
description:
name: carp_mobile_sensing
sha256: "1bc8d19d1b528c87abbf0a7624f356f8c77b09d950c563fef41da4d78b02cd3a"
sha256: ecd7cc3eff8af5133ac01a1bff703015fa5eca96f1ed62a72e5bfb15e61310bb
url: "https://pub.dev"
source: hosted
version: "1.4.2"
version: "1.4.3"
carp_polar_package:
dependency: "direct main"
description:
Expand Down

0 comments on commit 2f08e0e

Please sign in to comment.