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

View File

@ -219,7 +219,10 @@ async function submitButtonClickHandler(event) {
const submitView = dialog?.getElementsByClassName('report-dialog-submit-view')[0]; const submitView = dialog?.getElementsByClassName('report-dialog-submit-view')[0];
const userAgent = window.navigator.userAgent; const userAgent = window.navigator.userAgent;
const issueUrl = await dispatch({ userAgent, reason: reasonText, url: urlText, type: 'REPORT' }); 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'); formView?.setAttribute('hidden', 'true');
issueButton?.addEventListener('click', () => window.open(issueUrl, '_blank')); issueButton?.addEventListener('click', () => window.open(issueUrl, '_blank'));
submitView?.removeAttribute('hidden'); submitView?.removeAttribute('hidden');