@@ -149,27 +149,55 @@ index 4c16c85b5..8b93c6084 100644
149149+ }; /* </electron-mail-mark> */
150150
151151diff --git a/packages/components/hooks/useGetEncryptionPreferences.ts b/packages/components/hooks/useGetEncryptionPreferences.ts
152- index fe83b9e8c..b944a61e8 100644
152+ index dae0d635c7..6308e24fa9 100644
153153--- a/packages/components/hooks/useGetEncryptionPreferences.ts
154154+++ b/packages/components/hooks/useGetEncryptionPreferences.ts
155- @@ -24,7 +24,7 @@ const DEFAULT_LIFETIME = 5 * MINUTE;
156- * The logic for how those preferences are determined is laid out in the
157- * Confluence document 'Encryption preferences for outgoing email'
155+ @@ -5,7 +5,7 @@ import { MINUTE, RECIPIENT_TYPES } from '@proton/shared/lib/constants';
156+ import { getSelfSendAddresses } from '@proton/shared/lib/helpers/address';
157+ import { canonicalizeEmail, canonicalizeInternalEmail } from '@proton/shared/lib/helpers/email';
158+ import { KT_VERIFICATION_STATUS } from '@proton/shared/lib/interfaces';
159+ - import { GetEncryptionPreferences } from '@proton/shared/lib/interfaces/hooks/GetEncryptionPreferences';
160+ + import { GetEncryptionPreferences } from '@proton/shared/lib/interfaces/hooks/GetEncryptionPreferences'; /* <electron-mail-mark/> TODO "GetEncryptionPreferences" is used as a method signature */
161+ import { getKeyHasFlagsToEncrypt } from '@proton/shared/lib/keys';
162+ import { getActiveKeys } from '@proton/shared/lib/keys/getActiveKeys';
163+ import { splitKeys } from '@proton/shared/lib/keys/keys';
164+ @@ -31,7 +31,7 @@ const DEFAULT_LIFETIME = 5 * MINUTE;
165+ * Confluence document 'Encryption preferences for outgoing email'.
166+ * NB: the current logic does not handle internal address keys belonging to external accounts, since these keys are not used by Inbox.
158167 */
159168- const useGetEncryptionPreferences = () => {
160- + const useGetEncryptionPreferences = () => { /* <electron-mail-mark> */
169+ + const useGetEncryptionPreferences = () => { /* <electron-mail-mark> TODO "GetEncryptionPreferences" is used as a method signature */
161170 const api = useApi();
162171 const cache = useCache();
163172 const getAddresses = useGetAddresses();
164- @@ -87 ,6 +87 ,6 @@ const useGetEncryptionPreferences = () => {
173+ @@ -109 ,6 +109 ,6 @@ const useGetEncryptionPreferences = () => {
165174 },
166175 [cache, getEncryptionPreferences]
167176 );
168177- };
169- + }; /* </ electron-mail-mark> */
178+ + }; /* <electron-mail-mark> */
170179
171180 export default useGetEncryptionPreferences;
172181
182+ diff --git a/packages/shared/lib/interfaces/hooks/GetEncryptionPreferences.ts b/packages/shared/lib/interfaces/hooks/GetEncryptionPreferences.ts
183+ index d31b0bf797..407bb22503 100644
184+ --- a/packages/shared/lib/interfaces/hooks/GetEncryptionPreferences.ts
185+ +++ b/packages/shared/lib/interfaces/hooks/GetEncryptionPreferences.ts
186+ @@ -2,6 +2,7 @@ import { EncryptionPreferences } from '../../mail/encryptionPreferences';
187+ import { ContactEmail } from '../contacts';
188+
189+ export type GetEncryptionPreferences = ({
190+ + /* <electron-mail-mark> TODO review signatures */
191+ email,
192+ intendedForEmail,
193+ lifetime,
194+ @@ -15,4 +16,4 @@ export type GetEncryptionPreferences = ({
195+ intendedForEmail?: boolean;
196+ lifetime?: number;
197+ contactEmailsMap?: { [email: string]: ContactEmail | undefined };
198+ - }) => Promise<EncryptionPreferences>;
199+ + }) => Promise<EncryptionPreferences>;/* </electron-mail-mark> */
200+
173201diff --git a/packages/components/hooks/useApi.ts b/packages/components/hooks/useApi.ts
174202index e2baface5..8b4317d5a 100644
175203--- a/packages/components/hooks/useApi.ts
@@ -346,20 +374,19 @@ index 0d29745777..0000000000
346374- export default MailDefaultHandlerModal;
347375
348376diff --git a/applications/mail/src/app/components/header/search/MailSearch.tsx b/applications/mail/src/app/components/header/search/MailSearch.tsx
349- index 1736085ad3..5f102e159e 100644
377+ index 9b542628da..f26b6a9ccc 100644
350378--- a/applications/mail/src/app/components/header/search/MailSearch.tsx
351379+++ b/applications/mail/src/app/components/header/search/MailSearch.tsx
352- @@ -3,7 +3,6 @@ import { useEffect, useState } from 'react';
380+ @@ -3,21 +3,17 @@ import { useEffect, useState } from 'react';
353381 import { Location } from 'history';
354382
355383 import {
356384- FeatureCode,
357385 TopNavbarListItemSearchButton,
358386 generateUID,
359387 useAddresses,
360- @@ -11,14 +10,11 @@ import {
388+ useFolders,
361389 useLabels,
362- useMailSettings,
363390 usePopperAnchor,
364391- useProgressiveRollout,
365392 useToggle,
@@ -372,7 +399,7 @@ index 1736085ad3..5f102e159e 100644
372399 import { extractSearchParameters } from '../../../helpers/mailboxUrl';
373400 import { useClickMailContent } from '../../../hooks/useClickMailContent';
374401 import { Breakpoints } from '../../../models/utils';
375- @@ -39,11 +35,9 @@ interface Props {
402+ @@ -37,17 +33,15 @@ interface Props {
376403
377404 const MailSearch = ({ breakpoints, labelID, location, columnMode }: Props) => {
378405 const [uid] = useState(generateUID('advanced-search-overlay'));
@@ -381,13 +408,11 @@ index 1736085ad3..5f102e159e 100644
381408 const searchParams = extractSearchParameters(location);
382409 const [searchInputValue, setSearchInputValue] = useState(searchParams.keyword || '');
383410- const [user] = useUser();
384- const [, loadingMailSettings] = useMailSettings();
385411 const [, loadingLabels] = useLabels();
386412 const [, loadingFolders] = useFolders();
387- @@ -51,7 +45,7 @@ const MailSearch = ({ breakpoints, labelID, location, columnMode }: Props) => {
388- const { getESDBStatus, cacheIndexedDB, closeDropdown } = useEncryptedSearchContext();
389- const { dropdownOpened } = getESDBStatus();
390- const esState = useEncryptedSearchToggleState(isOpen);
413+ const [, loadingAddresses] = useAddresses();
414+ const { esStatus, cacheIndexedDB, closeDropdown, esIndexingProgressState } = useEncryptedSearchContext();
415+ const { dropdownOpened } = esStatus;
391416- const showEncryptedSearch = isEncryptedSearchAvailable(user, isESUserInterfaceAvailable);
392417+ const showEncryptedSearch = false;
393418
0 commit comments