Skip to content

Commit 9b5d579

Browse files
committed
Address review: Failed-to-save error copy, prefetch preferences in Extras route loader
1 parent f0120fe commit 9b5d579

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

client/dashboard/app/router/me.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,11 @@ export const notificationsExtrasRoute = createRoute( {
10101010
} ),
10111011
getParentRoute: () => notificationsRoute,
10121012
path: '/extras',
1013-
loader: () => queryClient.ensureQueryData( userNotificationsSettingsQuery() ),
1013+
loader: () =>
1014+
Promise.all( [
1015+
queryClient.ensureQueryData( userNotificationsSettingsQuery() ),
1016+
queryClient.ensureQueryData( rawUserPreferencesQuery() ),
1017+
] ),
10141018
} ).lazy( () =>
10151019
import( '../../me/notifications-extras' ).then( ( d ) =>
10161020
createLazyRoute( 'notifications-extras' )( {

client/dashboard/me/notifications-extras/achievements-card/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ export const AchievementsCard = () => {
3434
);
3535
},
3636
onError: () => {
37-
createErrorNotice( __( 'There was a problem saving your changes. Please, try again.' ), {
38-
type: 'snackbar',
39-
} );
37+
createErrorNotice(
38+
sprintf(
39+
/* translators: %s is the name of the setting */ __( 'Failed to save %s settings.' ),
40+
__( 'Achievements' )
41+
),
42+
{ type: 'snackbar' }
43+
);
4044
},
4145
} );
4246
};

client/dashboard/me/notifications-extras/on-this-day-card/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ export const OnThisDayCard = () => {
4141
);
4242
},
4343
onError: () => {
44-
createErrorNotice( __( 'There was a problem saving your changes. Please, try again.' ), {
45-
type: 'snackbar',
46-
} );
44+
createErrorNotice(
45+
sprintf(
46+
/* translators: %s is the name of the setting */ __( 'Failed to save %s settings.' ),
47+
__( 'On this day' )
48+
),
49+
{ type: 'snackbar' }
50+
);
4751
},
4852
}
4953
);

0 commit comments

Comments
 (0)