when closing the spam info panel, the report is deleted so the info is not displayed again. see #506

This commit is contained in:
mic 2026-02-08 22:22:00 +01:00
parent 7d843c0732
commit 0550077567
3 changed files with 9 additions and 0 deletions

View file

@ -654,6 +654,7 @@ switch (message.command) {
closeBtn.title = browser.i18n.getMessage("chatgpt_win_close");
closeBtn.onclick = function() {
container.remove();
browser.runtime.sendMessage({ command: "removeSpamReport", headerMessageId: data.headerMessageId });
};
container.appendChild(scoreText);

View file

@ -32,6 +32,11 @@ export const taSpamReport = {
return output[key] || null;
},
async removeReportData(data_id) {
const key = this._data_prefix + data_id;
await browser.storage.session.remove(key);
},
async getAllReportData() {
let allData = await browser.storage.session.get(null);
let reportData = {};

View file

@ -374,6 +374,9 @@ messenger.runtime.onMessage.addListener((message, sender, sendResponse) => {
}
_checkSpamReport(sender.tab.id);
break;
case 'removeSpamReport':
taSpamReport.removeReportData(message.headerMessageId);
break;
default:
break;
}