8.0.0 #3

Merged
wanhose merged 30 commits from v8.0.0 into main 2024-10-15 15:01:19 +00:00
2 changed files with 9 additions and 3 deletions
Showing only changes of commit c1d2a3d93a - Show all commits

View File

@ -294,7 +294,10 @@ browser.runtime.onMessage.addListener((message, sender, callback) => {
}
break;
case 'ENABLE_ICON':
if (isPage && tabId !== undefined) enableIcon(hostname, tabId);
if (isPage && tabId !== undefined) {
enableIcon(hostname, tabId).then(callback);
return true;
}
break;
case 'ENABLE_POPUP':
if (isPage && tabId !== undefined) {
@ -344,8 +347,8 @@ browser.runtime.onMessage.addListener((message, sender, callback) => {
}
break;
case 'UPDATE_STORE':
triggerStoreUpdate(hostname, message.state);
break;
triggerStoreUpdate(hostname, message.state).then(callback);
return true;
default:
break;
}

View File

@ -219,7 +219,10 @@ async function submitButtonClickHandler(event) {
const submitView = dialog?.getElementsByClassName('report-dialog-submit-view')[0];
const userAgent = window.navigator.userAgent;
const issueUrl = await dispatch({ userAgent, reason: reasonText, url: urlText, type: 'REPORT' });
const issue = { expiresIn: Date.now() + 8 * 60 * 60 * 1000, flags: ['bug'], url: issueUrl };
await dispatch({ hostname, state: { issue }, type: 'UPDATE_STORE' });
await dispatch({ hostname, type: 'ENABLE_ICON' });
formView?.setAttribute('hidden', 'true');
issueButton?.addEventListener('click', () => window.open(issueUrl, '_blank'));
submitView?.removeAttribute('hidden');