async function updateActionForMsg (tab, message) {
    const coverLetterRegex = / 0+\//;

    const msgFull = await browser.messages.getFull(message.id);

    const patchwork = await findPatchworkInstance(message, msgFull);
    if (!patchwork) {
        disableCurrentTab();
        return;
    }
    clearActionBadge();
    enableCurrentTab();

    const msgId = await getMessageId(msgFull);

    // message.subject trims the "Re: " prefix, get real subject from msgFull.
    const subject = msgFull.headers.subject[0];

    patchMetaData = await getPatchInfo(patchwork, msgId, coverLetterRegex.test(subject));

    // If we failed to get information for this patch, disable the button.
    if (!patchMetaData) {
        disableCurrentTab();
        return;
    }

    // Cover letters do not return state. Update for regular patches.
    if (patchMetaData.state) {
        updateActionBadge(patchMetaData.state);
    }
}
// - Update the badge, based on patch state.
Update the badge, based on patch state.
Update the badge based on patch state .
async function updateActionForMsg (tab, message) {
    const coverLetterRegex = / 0+\//;
    const msgFull = await browser.messages.getFull(message.id);
    const patchwork = await findPatchworkInstance(message, msgFull);
    if (!patchwork) {
        disableCurrentTab();
        return;
    }
    clearActionBadge();
    enableCurrentTab();
    const msgId = await getMessageId(msgFull);
    const subject = msgFull.headers.subject[0];
    patchMetaData = await getPatchInfo(patchwork, msgId, coverLetterRegex.test(subject));
    if (!patchMetaData) {
        disableCurrentTab();
        return;
    }
    if (patchMetaData.state) {
        updateActionBadge(patchMetaData.state);
    }
}
async function updateActionForMsg ( tab , message ) { const coverLetterRegex = /  0+\/ / ; const msgFull = await browser . messages . getFull ( message . id ) ; const patchwork = await findPatchworkInstance ( message , msgFull ) ; if ( ! patchwork ) { disableCurrentTab ( ) ; return ; } clearActionBadge ( ) ; enableCurrentTab ( ) ; const msgId = await getMessageId ( msgFull ) ; const subject = msgFull . headers . subject [ 0 ] ; patchMetaData = await getPatchInfo ( patchwork , msgId , coverLetterRegex . test ( subject ) ) ; if ( ! patchMetaData ) { disableCurrentTab ( ) ; return ; } if ( patchMetaData . state ) { updateActionBadge ( patchMetaData . state ) ; } }
Update the badge, based on patch state.
Update the badge based on patch state .
// message.subject trims the "Re: " prefix, get real subject from msgFull. // If we failed to get information for this patch, disable the button. // Cover letters do not return state. Update for regular patches.