Skip to content

Commit 4de3078

Browse files
authored
Allow retry when cannot update
1 parent 909453b commit 4de3078

File tree

4 files changed

+58
-22
lines changed

4 files changed

+58
-22
lines changed

_locales/en/messages.json

+16-2
Original file line numberDiff line numberDiff line change
@@ -1042,12 +1042,20 @@
10421042
"description": "Shown in a button when a conversation is unmuted and can be muted"
10431043
},
10441044
"cannotUpdateDetail": {
1045-
"message": "Signal Desktop failed to update, but there is a new version available. Please go to $url$ and install the new version manually, then either contact support or file a bug about this problem.",
1045+
"message": "Signal couldn't update. $retry$ or visit $url$ to install it manually. Then, $support$ about this problem",
10461046
"description": "Shown if a general error happened while trying to install update package",
10471047
"placeholders": {
1048+
"retry": {
1049+
"content": "$2",
1050+
"example": "retry update"
1051+
},
10481052
"url": {
1049-
"content": "$1",
1053+
"content": "$2",
10501054
"example": "https://signal.org/download"
1055+
},
1056+
"support": {
1057+
"content": "$3",
1058+
"example": "contact support"
10511059
}
10521060
}
10531061
},
@@ -2457,6 +2465,12 @@
24572465
"autoUpdateNewVersionTitle": {
24582466
"message": "Update available"
24592467
},
2468+
"autoUpdateRetry": {
2469+
"message": "Retry update"
2470+
},
2471+
"autoUpdateContactSupport": {
2472+
"message": "contact support"
2473+
},
24602474
"autoUpdateNewVersionMessage": {
24612475
"message": "Click to restart Signal"
24622476
},

stylesheets/components/LeftPaneDialog.scss

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
padding-left: 36px;
3333
}
3434

35+
&__retry {
36+
@include button-reset;
37+
@include font-body-1-bold;
38+
}
39+
3540
&--clickable {
3641
cursor: pointer;
3742
}

test/i18n_test.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@ describe('i18n', () => {
1212
assert.equal(i18n('reportIssue'), ['Contact Support']);
1313
});
1414
it('returns message with single substitution', () => {
15-
const actual = i18n('cannotUpdateDetail', [
16-
'https://signal.org/download',
17-
]);
18-
assert.equal(
19-
actual,
20-
'Signal Desktop failed to update, but there is a new version available. Please go to https://signal.org/download and install the new version manually, then either contact support or file a bug about this problem.'
21-
);
15+
const actual = i18n('migratingToSQLCipher', ['45/200']);
16+
assert.equal(actual, 'Optimizing messages... 45/200 complete.');
2217
});
2318
it('returns message with multiple substitutions', () => {
2419
const actual = i18n('theyChangedTheTimer', {

ts/components/DialogUpdate.tsx

+35-13
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,38 @@ export const DialogUpdate = ({
6868
>
6969
<span>
7070
<Intl
71-
components={[
72-
<a
73-
key="signal-download"
74-
href={url}
75-
rel="noreferrer"
76-
target="_blank"
77-
>
78-
{url}
79-
</a>,
80-
]}
71+
components={{
72+
retry: (
73+
<button
74+
className="LeftPaneDialog__retry"
75+
key="signal-retry"
76+
onClick={startUpdate}
77+
type="button"
78+
>
79+
{i18n('autoUpdateRetry')}
80+
</button>
81+
),
82+
url: (
83+
<a
84+
key="signal-download"
85+
href={url}
86+
rel="noreferrer"
87+
target="_blank"
88+
>
89+
{url}
90+
</a>
91+
),
92+
support: (
93+
<a
94+
key="signal-support"
95+
href="https://support.signal.org/hc/en-us/requests/new?desktop"
96+
rel="noreferrer"
97+
target="_blank"
98+
>
99+
{i18n('autoUpdateContactSupport')}
100+
</a>
101+
),
102+
}}
81103
i18n={i18n}
82104
id="cannotUpdateDetail"
83105
/>
@@ -89,12 +111,12 @@ export const DialogUpdate = ({
89111
if (dialogType === DialogType.MacOS_Read_Only) {
90112
return (
91113
<LeftPaneDialog
114+
closeLabel={i18n('close')}
92115
containerWidthBreakpoint={containerWidthBreakpoint}
93-
type="warning"
94-
title={i18n('cannotUpdate')}
95116
hasXButton
96-
closeLabel={i18n('close')}
97117
onClose={dismissDialog}
118+
title={i18n('cannotUpdate')}
119+
type="warning"
98120
>
99121
<span>
100122
<Intl

0 commit comments

Comments
 (0)