From c40698893d0d861c3b85b48ba2e6841611cd66cb Mon Sep 17 00:00:00 2001 From: Abby Wheelis Date: Wed, 1 Nov 2023 11:24:04 -0600 Subject: [PATCH] pushnotify relies on events now moving to event-driven paradigm, so we don't call the method from pushNotify directly. this will apply to storedevicesettings once it gets migrated --- www/js/onboarding/ProtocolPage.tsx | 1 - www/js/splash/startprefs.ts | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/www/js/onboarding/ProtocolPage.tsx b/www/js/onboarding/ProtocolPage.tsx index a047a0aae..1630748b4 100644 --- a/www/js/onboarding/ProtocolPage.tsx +++ b/www/js/onboarding/ProtocolPage.tsx @@ -6,7 +6,6 @@ import { resetDataAndRefresh } from '../config/dynamicConfig'; import { AppContext } from '../App'; import PrivacyPolicy from './PrivacyPolicy'; import { onboardingStyles } from './OnboardingStack'; -import { markConsented } from '../splash/startprefs'; import { setProtocolDone } from './onboardingHelper'; const ProtocolPage = () => { diff --git a/www/js/splash/startprefs.ts b/www/js/splash/startprefs.ts index 43f29c692..3c4823af7 100644 --- a/www/js/splash/startprefs.ts +++ b/www/js/splash/startprefs.ts @@ -2,6 +2,7 @@ import { getAngularService } from "../angular-react-helper"; import { storageGet, storageSet } from '../plugin/storage'; import { logInfo, logDebug, displayErrorMsg } from '../plugin/logger'; import { readIntroDone } from "../onboarding/onboardingHelper"; +import { EVENT_NAMES, publish } from "../customEventHandler"; // data collection consented protocol: string, represents the date on // which the consented protocol was approved by the IRB @@ -37,15 +38,16 @@ export function markConsented() { _req_consent); // mark in local variable as well _curr_consented = { ..._req_consent }; + // publish event + publish(EVENT_NAMES.CONSENTED_EVENT, _req_consent); }) //check for reconsent .then(readIntroDone) .then((isIntroDone) => { if (isIntroDone) { - logDebug("reconsent scenario - marked consent after intro done - registering pushnoify and storing device settings") - const PushNotify = getAngularService("PushNotify"); + logDebug("reconsent scenario - marked consent after intro done - registering pushnoify and storing device settings"); + //pushnotify uses events now const StoreSeviceSettings = getAngularService("StoreDeviceSettings"); - PushNotify.registerPush(); StoreSeviceSettings.storeDeviceSettings(); } })