Skip to content

Commit 59b46d5

Browse files
committed
Editor: Improve offline error notices
1 parent 60dd37c commit 59b46d5

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

packages/editor/src/store/utils/notice-builder.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,18 @@ export function getNotificationArgumentsForSaveFail( data ) {
9292

9393
if ( error.code === 'offline_error' ) {
9494
const messages = {
95-
publish: __( 'Publishing failed because you were offline.' ),
96-
private: __( 'Publishing failed because you were offline.' ),
97-
future: __( 'Scheduling failed because you were offline.' ),
98-
default: __( 'Updating failed because you were offline.' ),
95+
publish: __(
96+
'Publishing failed because you were offline. Please, verify your connection and try again.'
97+
),
98+
private: __(
99+
'Publishing failed because you were offline. Please, verify your connection and try again.'
100+
),
101+
future: __(
102+
'Scheduling failed because you were offline. Please, verify your connection and try again.'
103+
),
104+
default: __(
105+
'Updating failed because you were offline. Please, verify your connection and try again.'
106+
),
99107
};
100108

101109
const noticeMessage =

test/e2e/specs/editor/various/autosave.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ test.describe( 'Autosave', () => {
270270

271271
await expect(
272272
page.locator( '.components-notice__content' )
273-
).toContainText( 'Updating failed because you were offline.' );
273+
).toContainText(
274+
'Updating failed because you were offline. Please, verify your connection and try again.'
275+
);
274276
expect(
275277
await page.evaluate( () => window.sessionStorage.length )
276278
).toBe( 1 );

test/e2e/specs/editor/various/change-detection.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ test.describe( 'Change detection', () => {
243243
await expect(
244244
page
245245
.getByRole( 'region', { name: 'Editor content' } )
246-
.getByText( 'Updating failed because you were offline.' )
246+
.getByText(
247+
'Updating failed because you were offline. Please, verify your connection and try again.'
248+
)
247249
).toBeVisible();
248250
await expect(
249251
page

0 commit comments

Comments
 (0)