Skip to content

Commit 020313b

Browse files
committed
update @ProtonMail web clients
1 parent 83aaa16 commit 020313b

File tree

11 files changed

+62
-274
lines changed

11 files changed

+62
-274
lines changed

patches/protonmail/captcha-2.patch

Lines changed: 0 additions & 12 deletions
This file was deleted.

patches/protonmail/common.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ index 9aaa78a28..f3d24b47c 100644
5656
+{
5757
+ const platform = String(navigator.platform);
5858
+ const userAgents = {
59-
+ linux: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36",
60-
+ windows: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36",
61-
+ macos: "Mozilla/5.0 (Macintosh; Intel Mac OS X 12_2_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36"
59+
+ linux: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36",
60+
+ windows: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36",
61+
+ macos: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36"
6262
+ } as const;
6363
+ uaParser.setUA(
6464
+ platform.startsWith("Linux")
Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,61 @@
11
diff --git a/packages/shared/lib/constants.ts b/packages/shared/lib/constants.ts
2-
index 2bd472b..52cf521 100644
2+
index e3af4c1dc..aff74c45f 100644
33
--- a/packages/shared/lib/constants.ts
44
+++ b/packages/shared/lib/constants.ts
5-
@@ -36,8 +36,8 @@ export const APPS = {
5+
@@ -44,8 +44,8 @@ export const APPS = {
66
} as const;
77
export const APPS_CONFIGURATION = {
88
[APPS.PROTONACCOUNT]: {
99
- publicPath: '',
1010
- subdomain: 'account',
1111
+ publicPath: '/account',
1212
+ subdomain: '',
13-
name: 'Proton Account',
13+
name: ACCOUNT_APP_NAME,
1414
bareName: 'Account',
15-
clientID: 'WebAccount',
16-
@@ -46,7 +46,7 @@ export const APPS_CONFIGURATION = {
15+
clientID: 'web-account',
16+
@@ -63,7 +63,7 @@ export const APPS_CONFIGURATION = {
1717
},
1818
[APPS.PROTONMAIL]: {
1919
publicPath: '',
2020
- subdomain: 'mail',
2121
+ subdomain: '',
22-
name: 'ProtonMail',
22+
name: MAIL_APP_NAME,
2323
bareName: 'Mail',
24-
clientID: 'WebMail',
25-
@@ -55,7 +55,7 @@ export const APPS_CONFIGURATION = {
24+
clientID: 'web-mail',
25+
@@ -72,7 +72,7 @@ export const APPS_CONFIGURATION = {
2626
},
2727
[APPS.PROTONCONTACTS]: {
2828
publicPath: '/contacts',
2929
- subdomain: 'contacts',
3030
+ subdomain: '',
3131
name: 'ProtonContacts',
3232
bareName: 'Contacts',
33-
clientID: 'WebContacts',
34-
@@ -64,7 +64,7 @@ export const APPS_CONFIGURATION = {
33+
clientID: 'web-contacts',
34+
@@ -81,7 +81,7 @@ export const APPS_CONFIGURATION = {
3535
},
3636
[APPS.PROTONDRIVE]: {
3737
publicPath: '/drive',
3838
- subdomain: 'drive',
3939
+ subdomain: '',
40-
name: 'ProtonDrive',
40+
name: DRIVE_APP_NAME,
4141
bareName: 'Drive',
42-
clientID: 'WebDrive',
43-
@@ -73,7 +73,7 @@ export const APPS_CONFIGURATION = {
42+
clientID: 'web-drive',
43+
@@ -90,7 +90,7 @@ export const APPS_CONFIGURATION = {
4444
},
4545
[APPS.PROTONCALENDAR]: {
4646
publicPath: '/calendar',
4747
- subdomain: 'calendar',
4848
+ subdomain: '',
49-
name: 'ProtonCalendar',
49+
name: CALENDAR_APP_NAME,
5050
bareName: 'Calendar',
51-
clientID: 'WebCalendar',
51+
clientID: 'web-calendar',
52+
@@ -98,7 +98,7 @@ export const APPS_CONFIGURATION = {
53+
settingsSlug: 'calendar',
54+
},
55+
[APPS.PROTONVPN_SETTINGS]: {
56+
- publicPath: '',
57+
+ publicPath: 'account/vpn',
58+
subdomain: '',
59+
name: VPN_APP_NAME,
60+
bareName: 'VPN',
61+
Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/packages/components/hooks/useLinkHandler.tsx b/packages/components/hooks/useLinkHandler.tsx
2-
index e65208ec9..6178f5aaf 100644
2+
index 7fdec1d3b..256ddf8be 100644
33
--- a/packages/components/hooks/useLinkHandler.tsx
44
+++ b/packages/components/hooks/useLinkHandler.tsx
55
@@ -4,7 +4,7 @@ import punycode from 'punycode.js';
@@ -11,7 +11,7 @@ index e65208ec9..6178f5aaf 100644
1111
import isTruthy from '@proton/shared/lib/helpers/isTruthy';
1212
import { PROTON_DOMAINS } from '@proton/shared/lib/constants';
1313

14-
@@ -162,6 +162,10 @@ export const useLinkHandler: UseLinkHandler = (
14+
@@ -163,6 +163,10 @@ export const useLinkHandler: UseLinkHandler = (
1515
return;
1616
}
1717

@@ -22,27 +22,20 @@ index e65208ec9..6178f5aaf 100644
2222
if (
2323
askForConfirmation &&
2424
isExternal(src.raw) &&
25-
@@ -169,20 +173,17 @@ export const useLinkHandler: UseLinkHandler = (
25+
@@ -170,13 +174,10 @@ export const useLinkHandler: UseLinkHandler = (
2626
.filter(isTruthy) // currentDomain can be null
2727
.some((domain) => isSubDomain(hostname, domain))
2828
) {
2929
- event.preventDefault();
3030
- event.stopPropagation(); // Required for Safari
3131
-
3232
- const link = await encoder(src);
33+
- setLink(link);
3334
-
34-
const modalId = createModal(
35-
<LinkConfirmationModal
36-
- link={link}
37-
+ link={encodedLink}
38-
onClose={() => setConfirmationModalID(undefined)}
39-
isOutside={isOutside}
40-
/>
41-
);
42-
43-
setConfirmationModalID(modalId);
35+
+ setLink(encodedLink);
36+
setLinkConfirmationModalOpen(true);
4437
+ } else {
4538
+ openNewTab(encodedLink);
4639
}
4740
});
48-
41+

patches/protonmail/meta.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"sentry-4.patch",
66
"captcha-3.patch",
77
"pack-api-arg-3.patch",
8-
"pack-webpack-config-2.patch",
8+
"pack-webpack-config-3.patch",
99
"session-storage-2.patch",
10-
"link-handler.patch",
10+
"link-handler-2.patch",
1111
"proton-mail.patch"
1212
],
1313
"proton-account": [
@@ -16,39 +16,40 @@
1616
"sentry-4.patch",
1717
"captcha-3.patch",
1818
"pack-api-arg-3.patch",
19-
"pack-webpack-config-2.patch",
19+
"pack-webpack-config-3.patch",
2020
"session-storage-2.patch",
21-
"link-handler.patch",
21+
"link-handler-2.patch",
2222
"proton-account.patch"
2323
],
2424
"proton-calendar": [
2525
"common.patch",
2626
"constants-2.patch",
2727
"sentry-4.patch",
2828
"captcha-3.patch",
29-
"pack-api-arg-2.patch",
30-
"pack-webpack-config-1.patch",
31-
"link-handler.patch",
29+
"pack-api-arg-3.patch",
30+
"pack-webpack-config-3.patch",
31+
"link-handler-2.patch",
3232
"session-storage-2.patch"
3333
],
3434
"proton-drive": [
3535
"common.patch",
36-
"constants-2.patch",
36+
"constants-3.patch",
3737
"sentry-4.patch",
3838
"captcha-3.patch",
3939
"pack-api-arg-3.patch",
40-
"pack-webpack-config-2.patch",
40+
"pack-webpack-config-3.patch",
4141
"session-storage-2.patch",
42-
"link-handler.patch",
42+
"link-handler-2.patch",
4343
"proton-drive.patch"
4444
],
4545
"proton-vpn-settings": [
4646
"common.patch",
47-
"constants-1.patch",
48-
"sentry-3.patch",
49-
"captcha-2.patch",
50-
"pack-api-arg-1.patch",
51-
"pack-webpack-config-1.patch",
52-
"session-storage-2.patch"
47+
"constants-2.patch",
48+
"sentry-4.patch",
49+
"captcha-3.patch",
50+
"pack-api-arg-3.patch",
51+
"pack-webpack-config-3.patch",
52+
"session-storage-2.patch",
53+
"link-handler-2.patch"
5354
]
5455
}

patches/protonmail/pack-api-arg-1.patch

Lines changed: 0 additions & 33 deletions
This file was deleted.

patches/protonmail/pack-api-arg-2.patch

Lines changed: 0 additions & 33 deletions
This file was deleted.

patches/protonmail/pack-webpack-config-2.patch

Lines changed: 0 additions & 35 deletions
This file was deleted.

patches/protonmail/pack-webpack-config-1.patch renamed to patches/protonmail/pack-webpack-config-3.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
diff --git a/packages/pack/webpack.config.js b/packages/pack/webpack.config.js
2-
index dbfc3b18d..89807e7dd 100644
2+
index a39cbea19..8069fc544 100644
33
--- a/packages/pack/webpack.config.js
44
+++ b/packages/pack/webpack.config.js
5-
@@ -28,7 +28,20 @@ const getConfig = (env) => {
6-
},
5+
@@ -32,7 +32,20 @@ const getConfig = (env) => {
6+
overlayErrors: env.overlayErrors || false,
77
};
88

99
- return {
@@ -13,7 +13,7 @@ index dbfc3b18d..89807e7dd 100644
1313
+ console.log(
1414
+ /*reset:*/"\x1b[0m" +
1515
+ /*yellow:*/"\x1b[33m" +
16-
+ ">>> " +
16+
+ ">>>" +
1717
+ /*reset:*/"\x1b[0m",
1818
+ `Found ${file}, extend the config`,
1919
+ )
@@ -24,7 +24,7 @@ index dbfc3b18d..89807e7dd 100644
2424
target: options.isProduction ? `browserslist:${options.browserslist}` : 'web', // dev-server bug https://github.com/webpack/webpack-dev-server/issues/2812
2525
mode: options.isProduction ? 'production' : 'development',
2626
bail: options.isProduction,
27-
@@ -103,7 +116,7 @@ const getConfig = (env) => {
27+
@@ -118,7 +131,7 @@ const getConfig = (env) => {
2828
},
2929
}),
3030
},

0 commit comments

Comments
 (0)