Skip to content

Commit

Permalink
update @ProtonMail web clients
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Oct 28, 2022
1 parent 0e096bf commit 25520ba
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 460 deletions.
24 changes: 0 additions & 24 deletions patches/protonmail/constants-4.patch

This file was deleted.

1 change: 0 additions & 1 deletion patches/protonmail/embedded-verification-2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ index 9bfef3d1f..546b273c8 100644
-export * from './verification';
export * from './v5WelcomeModal';
export * from './vpn';
--

diff --git a/packages/components/containers/verification/EmbeddedVerification.tsx b/packages/components/containers/verification/EmbeddedVerification.tsx
deleted file mode 100644
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
diff --git a/packages/components/containers/index.ts b/packages/components/containers/index.ts
index fd20d8e62..7c3e55c87 100644
index a83ab6ba5..44da559d6 100644
--- a/packages/components/containers/index.ts
+++ b/packages/components/containers/index.ts
@@ -56,6 +56,5 @@ export * from './sessions';
@@ -60,5 +60,4 @@ export * from './sessions';
export * from './support';
export * from './themes';
export * from './topBanners';
-export * from './verification';
export * from './v5WelcomeModal';
export * from './vpn';

diff --git a/packages/components/containers/verification/EmbeddedVerification.tsx b/packages/components/containers/verification/EmbeddedVerification.tsx
deleted file mode 100644
index 242be9084..000000000
index 6425df9ec..000000000
--- a/packages/components/containers/verification/EmbeddedVerification.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
@@ -1,103 +0,0 @@
-import { useEffect, useMemo, useRef, useState } from 'react';
-import { localeCode } from '@proton/shared/lib/i18n';
-
-import { APPS } from '@proton/shared/lib/constants';
-import { HumanVerificationMethodType } from '@proton/shared/lib/interfaces';
-import { getAppUrlFromApiUrl, getAppUrlRelativeToOrigin, stringifySearchParams } from '@proton/shared/lib/helpers/url';
-import { localeCode } from '@proton/shared/lib/i18n';
-import { HumanVerificationMethodType } from '@proton/shared/lib/interfaces';
-
-import { useConfig, useNotifications } from '../../hooks';
-
Expand Down Expand Up @@ -121,8 +121,8 @@ index 242be9084..000000000

diff --git a/packages/components/containers/verification/index.ts b/packages/components/containers/verification/index.ts
deleted file mode 100644
index 8da2cc627..000000000
index 16a977e60..000000000
--- a/packages/components/containers/verification/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as EmbeddedVerification } from './EmbeddedVerification'
-export { default as EmbeddedVerification } from './EmbeddedVerification';
42 changes: 0 additions & 42 deletions patches/protonmail/link-handler-5.patch

This file was deleted.

56 changes: 28 additions & 28 deletions patches/protonmail/meta.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
{
"proton-mail": [
"common.patch",
"url-2.patch",
"constants-4.patch",
"url-3.patch",
"constants-5.patch",
"sentry-8.patch",
"pack-api-arg-3.patch",
"pack-webpack-5.patch",
"session-storage-3.patch",
"link-handler-5.patch",
"embedded-verification-1.patch",
"pack-api-arg-4.patch",
"pack-webpack-6.patch",
"session-storage-4.patch",
"link-handler-6.patch",
"embedded-verification-3.patch",
"proton-mail.patch"
],
"proton-account": [
"common.patch",
"url-3.patch",
"constants-5.patch",
"sentry-8.patch",
"pack-api-arg-3.patch",
"pack-webpack-5.patch",
"pack-api-arg-4.patch",
"pack-webpack-6.patch",
"session-storage-4.patch",
"link-handler-6.patch",
"embedded-verification-2.patch",
"embedded-verification-3.patch",
"proton-account.patch"
],
"proton-calendar": [
"common.patch",
"url-2.patch",
"constants-4.patch",
"url-3.patch",
"constants-5.patch",
"sentry-8.patch",
"pack-api-arg-3.patch",
"pack-webpack-5.patch",
"session-storage-3.patch",
"link-handler-5.patch",
"embedded-verification-1.patch"
"session-storage-4.patch",
"link-handler-6.patch",
"embedded-verification-2.patch"
],
"proton-drive": [
"common.patch",
"url-2.patch",
"constants-4.patch",
"url-3.patch",
"constants-5.patch",
"sentry-8.patch",
"pack-api-arg-3.patch",
"pack-webpack-4.patch",
"session-storage-3.patch",
"link-handler-5.patch",
"embedded-verification-1.patch",
"pack-webpack-5.patch",
"session-storage-4.patch",
"link-handler-6.patch",
"embedded-verification-2.patch",
"proton-drive.patch"
],
"proton-vpn-settings": [
"common.patch",
"url-2.patch",
"constants-4.patch",
"url-3.patch",
"constants-5.patch",
"sentry-8.patch",
"pack-api-arg-3.patch",
"pack-webpack-5.patch",
"session-storage-3.patch",
"link-handler-5.patch",
"embedded-verification-1.patch"
"pack-api-arg-4.patch",
"pack-webpack-6.patch",
"session-storage-4.patch",
"link-handler-6.patch",
"embedded-verification-3.patch"
]
}
13 changes: 13 additions & 0 deletions patches/protonmail/pack-api-arg-4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/packages/pack/lib/config.js b/packages/pack/lib/config.js
index b6484f719..a8ebc7fc0 100644
--- a/packages/pack/lib/config.js
+++ b/packages/pack/lib/config.js
@@ -129,7 +129,7 @@ const getConfigFile = ({ buildData, appData }) => {
export const BRANCH = '${buildData.branch}';
export const DATE_VERSION = '${buildData.date}';
export const APP_NAME = '${appData.appName}';
- export const API_URL = '${(!appData.apiProxy && appData.api) || '/api'}';
+ export const API_URL = '${appData.api}';
export const LOCALES = ${JSON.stringify(LOCALES)};
export const VERSION_PATH = '${appData.publicPath}assets/version.json';
export const SENTRY_DSN = '${appData.sentryDsn}';
49 changes: 0 additions & 49 deletions patches/protonmail/pack-webpack-4.patch

This file was deleted.

44 changes: 44 additions & 0 deletions patches/protonmail/pack-webpack-6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/packages/pack/webpack.config.js b/packages/pack/webpack.config.js
index 9fdd56f70..3a7300257 100644
--- a/packages/pack/webpack.config.js
+++ b/packages/pack/webpack.config.js
@@ -15,7 +15,7 @@ const getConfig = (env) => {
api: env.api,
appMode: env.appMode || 'standalone',
featureFlags: env.featureFlags || '',
- writeSRI: env.writeSri !== 'false',
+ writeSRI: false,
browserslist: isProduction
? `> 0.5%, not IE 11, Firefox ESR, Safari 11`
: 'last 1 chrome version, last 1 firefox version, last 1 safari version',
@@ -33,7 +33,20 @@ const getConfig = (env) => {
logical: env.logical || false,
};

- return {
+ return (() => {
+ const file = path.resolve("./proton.config.js");
+ if (require("fs").existsSync(file)) {
+ console.log(
+ /*reset:*/"\x1b[0m" +
+ /*yellow:*/"\x1b[33m" +
+ ">>>" +
+ /*reset:*/"\x1b[0m", +
+ `Found ${file}, extend the config`,
+ )
+ return require(file);
+ }
+ return (value) => value;
+ })()({
target: `browserslist:${options.browserslist}`,
mode: options.isProduction ? 'production' : 'development',
bail: options.isProduction,
@@ -120,7 +133,7 @@ const getConfig = (env) => {
},
}),
},
- };
+ });
};

module.exports = getConfig;
4 changes: 2 additions & 2 deletions patches/protonmail/proton-mail.patch
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ index e2baface5..8b4317d5a 100644
export default useApi;

diff --git a/packages/components/hooks/useAuthentication.ts b/packages/components/hooks/useAuthentication.ts
index feb92a8af..d802ae8ae 100644
index 2bab0ad85..51fc1fd18 100644
--- a/packages/components/hooks/useAuthentication.ts
+++ b/packages/components/hooks/useAuthentication.ts
@@ -3,9 +3,9 @@ import { useContext } from 'react';
import AuthenticationContext from '../containers/authentication/authenticationContext';
import { PrivateAuthenticationStore } from '../containers/app/interface';
import AuthenticationContext from '../containers/authentication/authenticationContext';

-const useAuthentication = () => {
+const useAuthentication = () => { /* <electron-mail-mark> */
Expand Down

0 comments on commit 25520ba

Please sign in to comment.