Skip to content

Commit

Permalink
ensure proper initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Abby Wheelis committed Oct 31, 2023
1 parent a90af2f commit 09cbaa1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions www/js/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { OnboardingRoute, OnboardingState, getPendingOnboardingState } from './o
import { setServerConnSettings } from './config/serverConn';
import AppStatusModal from './control/AppStatusModal';
import usePermissionStatus from './usePermissionStatus';
import { initPushNotify } from './splash/pushNotifySettings';

const defaultRoutes = (t) => [
{ key: 'label', title: t('diary.label-tab'), focusedIcon: 'check-bold', unfocusedIcon: 'check-outline' },
Expand Down Expand Up @@ -52,6 +53,7 @@ const App = () => {
setServerConnSettings(appConfig).then(() => {
refreshOnboardingState();
});
initPushNotify();
}, [appConfig]);

const appContextValue = {
Expand Down
2 changes: 2 additions & 0 deletions www/js/onboarding/onboardingHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { getAngularService } from "../angular-react-helper";
import { getConfig, resetDataAndRefresh } from "../config/dynamicConfig";
import { storageGet, storageSet } from "../plugin/storage";
import { logDebug } from "../plugin/logger";
import { EVENT_NAMES, publish } from "../customEventHandler";

export const INTRO_DONE_KEY = 'intro_done';

Expand Down Expand Up @@ -71,5 +72,6 @@ async function readIntroDone() {

export async function markIntroDone() {
const currDateTime = DateTime.now().toISO();
publish(EVENT_NAMES.INTRO_DONE_EVENT, currDateTime);
return storageSet(INTRO_DONE_KEY, currDateTime);
}
2 changes: 1 addition & 1 deletion www/js/splash/pushNotifySettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const onIntroEvent = function (event, data) {
* startup code -
* @function registers push if consented, subscribes event listeners for local handline
*/
const initPushNotify = function () {
export const initPushNotify = function () {
const StartPrefs = getAngularService('StartPrefs');
StartPrefs.readConsentState()
.then(StartPrefs.isConsented)
Expand Down

0 comments on commit 09cbaa1

Please sign in to comment.