-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsummary.js
28 lines (23 loc) · 963 Bytes
/
summary.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
document.getElementById('backButton').addEventListener('click', () => {
window.location.href = 'popup.html';
});
function displaySummary() {
const summaryText = document.getElementById('summaryText');
const folderTitle = document.getElementById('folderTitle');
chrome.runtime.sendMessage({ type: 'getSummary' }, (response) => {
if (chrome.runtime.lastError) {
console.error('Error getting summary:', chrome.runtime.lastError);
summaryText.textContent = 'Error retrieving summary. Please try again.';
return;
}
// Display folder name
folderTitle.textContent = `Summary of "${response.folderName}"`;
// Display summary with proper formatting
if (response.summary) {
summaryText.textContent = response.summary;
} else {
summaryText.textContent = 'No summary available.';
}
});
}
displaySummary();