fix sync issue in debug tab
This commit is contained in:
Binary file not shown.
@@ -130,7 +130,20 @@ document.getElementById('syncFilesBtn').addEventListener('click', async function
|
||||
}
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
console.log('Sync response status:', response.status);
|
||||
console.log('Sync response headers:', Object.fromEntries(response.headers.entries()));
|
||||
|
||||
const responseText = await response.text();
|
||||
console.log('Sync response text:', responseText);
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(responseText);
|
||||
console.log('Parsed sync response:', data);
|
||||
} catch (parseError) {
|
||||
console.error('JSON parse error:', parseError);
|
||||
throw new Error('Invalid response format from server');
|
||||
}
|
||||
|
||||
if (response.ok) {
|
||||
status.textContent = 'Sync completed successfully!';
|
||||
@@ -139,6 +152,7 @@ document.getElementById('syncFilesBtn').addEventListener('click', async function
|
||||
throw new Error(data.error || 'Sync failed');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Sync error:', error);
|
||||
status.textContent = error.message;
|
||||
status.className = 'text-danger small';
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user