Skip to content

Commit d657375

Browse files
authored
cherrypick #3519 #3526 (#3527)
* chore(tauri): use relative time for perf update date (#3519) * feat(tauri): add new tunnel errors (#3526)
1 parent c2d176c commit d657375

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

nym-vpn-app/src/hooks/useI18nError.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ function useI18nError() {
6565
);
6666
case 'credential-wasted-on-exit-gateway':
6767
return fmtErr(t('tunnel.exit-gateway-bandwidth-increase'), message);
68+
case 'performant-entry-gw-unavailable':
69+
return fmtErr(t('tunnel.performant-entry-gw-unavailable'), message);
70+
case 'performant-exit-gw-unavailable':
71+
return fmtErr(t('tunnel.performant-exit-gw-unavailable'), message);
6872
}
6973
}
7074
// not a tunnel error

nym-vpn-app/src/hooks/useScore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function useScore() {
4747
};
4848
case 'low':
4949
return {
50-
color: 'text-malachite-moss dark:text-malachite',
50+
color: 'text-malachite',
5151
label: t('node-details.server-load-score.low'),
5252
};
5353
case 'medium':

nym-vpn-app/src/i18n/en/errors.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"inactive-account": "Your account is inactive",
2626
"device-logged-out": "This device has been logged out. Please log in to continue using the VPN.",
2727
"entry-gateway-bandwidth-increase": "Entry gateway is not responding or responding badly to a bandwidth increase.",
28-
"exit-gateway-bandwidth-increase": "Exit gateway is not responding or responding badly to a bandwidth increase."
28+
"exit-gateway-bandwidth-increase": "Exit gateway is not responding or responding badly to a bandwidth increase.",
29+
"performant-entry-gw-unavailable": "The entry gateway can't connect. Try another!",
30+
"performant-exit-gw-unavailable": "The exit gateway can't connect. Try another!"
2931
},
3032
"account": {
3133
"internal": "Internal account error",

nym-vpn-app/src/i18n/en/node-location.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
},
5151
"notes": {
5252
"anti-censorship": "Enable “QUIC protocol” in Anti-censorship Settings to use this feature",
53-
"performance_with_date": "Performance score calculated from server load and uptime. Uptime as last 24-hours average. Last update {{date}}.",
53+
"performance_with_time": "Performance score calculated from server load and uptime. Uptime as last 24-hours average. Last update {{relativeTime}}.",
5454
"performance": "Performance score calculated from server load and uptime. Uptime as last 24-hours average."
5555
},
5656
"links": {

nym-vpn-app/src/screens/node/details/NodeDetails.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import clsx from 'clsx';
3+
import dayjs from 'dayjs';
34
import * as H from 'history';
45
import { Trans, useTranslation } from 'react-i18next';
56
import { useLocation, useNavigate } from 'react-router';
@@ -247,8 +248,8 @@ function NodeDetails() {
247248
];
248249

249250
const card2Footer = lastUpdate
250-
? t('node-details.notes.performance_with_date', {
251-
date: lastUpdate,
251+
? t('node-details.notes.performance_with_time', {
252+
relativeTime: dayjs().to(dayjs(lastUpdate)),
252253
})
253254
: t('node-details.notes.performance');
254255

nym-vpn-app/src/types/tunnel.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ export type TunnelError =
8585
| { key: 'set-dns'; message: string | null }
8686
| { key: 'set-routing'; message: string | null }
8787
| { key: 'same-entry-and-exit-gw'; message: string | null }
88+
| { key: 'performant-entry-gw-unavailable'; message: string | null }
89+
| { key: 'performant-exit-gw-unavailable'; message: string | null }
8890
| { key: 'invalid-entry-gw-country'; message: string | null }
8991
| { key: 'invalid-exit-gw-country'; message: string | null }
9092
| { key: 'max-devices-reached'; message: string | null }

0 commit comments

Comments
 (0)