Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / applications / drive / src / app / components / hasValidAnonymousSignature.ts
blobce5869a6f4c1df16beda0bc7544bd21215a135c3
1 import { VERIFICATION_STATUS } from '@proton/srp/lib/constants';
3 import { type SignatureIssues } from '../store';
5 export const hasValidAnonymousSignature = (signatureIssues: SignatureIssues) => {
6     return Object.entries(signatureIssues).every(([key, verified]) => {
7         if (key === 'thumbnail' || key === 'blocks') {
8             if (verified === VERIFICATION_STATUS.NOT_SIGNED) {
9                 return true;
10             } else {
11                 console.warn(`${key} signature should not be signed in case of anonymous upload`);
12                 return false;
13             }
14         } else {
15             return verified === VERIFICATION_STATUS.SIGNED_AND_VALID;
16         }
17     });