Skip to content

Commit

Permalink
Merge pull request #7 from chinkan/feature/cache-issue-fix
Browse files Browse the repository at this point in the history
bugs: fix cache not load issue
  • Loading branch information
chinkan authored Sep 15, 2024
2 parents f2a3130 + 1221fcb commit 5badf92
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ document.addEventListener('DOMContentLoaded', async function () {
chrome.tabs.query({ active: true, currentWindow: true }, resolve);
});
const currentUrl = tabs[0].url;
const result = await getStorageData(currentUrl);
if (result[currentUrl]) {
displaySummary(result[currentUrl].summary);
const result = await getStorageData(['histories']);
if (result && result.histories && result.histories[currentUrl]) {
displaySummary(result.histories[currentUrl].summary);
} else {
await generateSummary();
}
Expand Down Expand Up @@ -78,10 +78,6 @@ document.addEventListener('DOMContentLoaded', async function () {
selectPromptIndex
) {
try {
console.error(
'selectPromptIndex before send message',
selectPromptIndex
);
const response = await chrome.runtime.sendMessage({
action: 'summarize',
text: content,
Expand Down

0 comments on commit 5badf92

Please sign in to comment.