Skip to content

Commit 4a97fbc

Browse files
authored
Merge pull request #2112 from ChildMindInstitute/develop
Release 2025.07.2
2 parents 238bea2 + ab63d21 commit 4a97fbc

6 files changed

Lines changed: 617 additions & 198 deletions

File tree

src/modules/Dashboard/hooks/useDecryptedActivityData.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { useParams } from 'react-router-dom';
22

3-
import { applet } from 'shared/state/Applet';
4-
import { Encryption, getParsedEncryptionFromServer, SessionStorageKeys } from 'shared/utils';
3+
import { ItemResponseType } from 'shared/consts';
54
import { useEncryptionStorage } from 'shared/hooks';
5+
import { applet } from 'shared/state/Applet';
66
import { DecryptedActivityData, EncryptedAnswerSharedProps } from 'shared/types';
7-
import { ItemResponseType } from 'shared/consts';
7+
import { checkIfShouldLogging, Encryption, getParsedEncryptionFromServer } from 'shared/utils';
88
import { getDecryptedAnswers } from 'shared/utils/exportData/getDecryptedAnswers';
9-
import { isProduction } from 'shared/utils/env';
109

1110
export const getEmptyDecryptedActivityData = () => ({
1211
decryptedAnswers: [],
@@ -22,8 +21,7 @@ export const useDecryptedActivityData = (
2221
const encryption = appletData?.encryption;
2322
const encryptionInfoFromServer = getParsedEncryptionFromServer(dynamicEncryption ?? encryption);
2423
const { getAppletPrivateKey } = useEncryptionStorage();
25-
const shouldLogDataInDebugMode =
26-
!isProduction && sessionStorage.getItem(SessionStorageKeys.DebugMode) === 'true';
24+
const shouldLogDataInDebugMode = checkIfShouldLogging();
2725

2826
if (!encryptionInfoFromServer) return getEmptyDecryptedActivityData;
2927

src/shared/features/AppletSettings/ExportDataSetting/Popups/DataExportPopup/DataExportPopup.hooks.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { useEffect, useRef, useState } from 'react';
22

3-
import { getParsedEncryptionFromServer } from 'shared/utils/encryption';
4-
import { ExportDataResult } from 'shared/types/answer';
5-
import { isProduction } from 'shared/utils/env';
6-
import { SessionStorageKeys } from 'shared/utils/storage';
7-
import { useFeatureFlags } from 'shared/hooks';
83
import { MultipleDecryptWorkersProps } from 'shared/features/AppletSettings/ExportDataSetting/Popups/DataExportPopup/DataExportPopup.types';
94
import { DataExportWorkersManager as DataExportWorkersManagerClass } from 'shared/features/AppletSettings/ExportDataSetting/Popups/DataExportPopup/DataExportWorkersManager';
5+
import { useFeatureFlags } from 'shared/hooks';
6+
import { ExportDataResult } from 'shared/types/answer';
7+
import { checkIfShouldLogging } from 'shared/utils';
8+
import { getParsedEncryptionFromServer } from 'shared/utils/encryption';
109

1110
export const useMultipleDecryptWorkers = ({
1211
handleExportPopupClose,
@@ -23,8 +22,7 @@ export const useMultipleDecryptWorkers = ({
2322
const encryptionInfoFromServer = getParsedEncryptionFromServer(encryption);
2423
const { featureFlags } = useFeatureFlags();
2524

26-
const shouldLogDataInDebugMode =
27-
!isProduction && sessionStorage.getItem(SessionStorageKeys.DebugMode) === 'true';
25+
const shouldLogDataInDebugMode = checkIfShouldLogging();
2826

2927
const DataExportWorkerManager = useRef(
3028
new DataExportWorkersManagerClass(

0 commit comments

Comments
 (0)