Skip to content

Commit 37a5608

Browse files
authored
Show logs button when Studio ask to contact support (#765)
* Show logs button when Studio ask to contact support * Update tests according to latest changes
1 parent e79731b commit 37a5608

4 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎src/hooks/sync-sites/use-sync-push.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ export function useSyncPush( {
111111
message:
112112
response.error === 'Import timed out'
113113
? __(
114-
"A timeout error occurred while pushing the site, likely due to its large size. Please try reducing the site's content or files and try again. If the problem persists, contact support."
114+
"A timeout error occurred while pushing the site, likely due to its large size. Please try reducing the site's content or files and try again. If this problem persists, please contact support."
115115
)
116116
: __(
117117
'An error occurred while pushing the site. If this problem persists, please contact support.'
118118
),
119+
showOpenLogs: true,
119120
} );
120121
}
121122
// Update state in any case to keep polling push state
@@ -179,6 +180,7 @@ export function useSyncPush( {
179180
'An error occurred while pushing the site. If this problem persists, please contact support.'
180181
),
181182
error,
183+
showOpenLogs: true,
182184
} );
183185
return;
184186
}

‎src/hooks/tests/use-import-export.test.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ describe( 'useImportExport hook', () => {
9090
message:
9191
'An error occurred while exporting the site. If this problem persists, please contact support.',
9292
error: 'error',
93+
showOpenLogs: true,
9394
} );
9495
} );
9596

@@ -244,6 +245,7 @@ describe( 'useImportExport hook', () => {
244245
message:
245246
'An error occurred while importing the site. Verify the file is a valid Jetpack backup, Local, Playground, .wpress or .sql database file and try again. If this problem persists, please contact support.',
246247
error: 'error',
248+
showOpenLogs: true,
247249
} );
248250
} );
249251

‎src/hooks/use-import-export.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const ImportExportProvider = ( { children }: { children: React.ReactNode
9191
'An error occurred while importing the site. Verify the file is a valid Jetpack backup, Local, Playground, .wpress or .sql database file and try again. If this problem persists, please contact support.'
9292
),
9393
error,
94+
showOpenLogs: true,
9495
} );
9596
setImportState( ( { [ selectedSite.id ]: currentProgress, ...rest } ) => ( {
9697
...rest,
@@ -252,6 +253,7 @@ export const ImportExportProvider = ( { children }: { children: React.ReactNode
252253
'An error occurred while exporting the site. If this problem persists, please contact support.'
253254
),
254255
error,
256+
showOpenLogs: true,
255257
} );
256258

257259
try {

‎src/hooks/use-site-details.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ export function SiteDetailsProvider( { children }: SiteDetailsProviderProps ) {
200200
'An error occurred while creating the site. Verify your selected local path is an empty directory or an existing WordPress folder and try again. If this problem persists, please contact support.'
201201
),
202202
error,
203+
showOpenLogs: true,
203204
} );
204205

205206
// Remove the temporary site immediately, but with a minor delay to ensure state updates properly

0 commit comments

Comments
 (0)