InboxSdk not showing custom botton on gmail reply view

53 views Asked by At

I am trying to add a custom button to the toolbar of both the compose window and the reply window of Gmail.

The issue I have is that the custom button shows on the compose view but not the reply view.

see my code


InboxSDK.load(2, '<appId>', { appName: 'appName' }).then(function(sdk) {
  sdk.Compose.registerComposeViewHandler(function (composeView) {
    console.log('compose view exist');
    composeView.addButton({
      title: 'X Extension',
      iconUrl: window.chrome.extension.getURL('img/logos/48.png'),
      hasDropdown: true,
      noOverflow: true,
      onClick: async (event) => {
        const el = event.dropdown.el
        el.style.width = '330px'
        el.style.height = '470px'
        el.style.overflow = 'hidden'
        el.style.backgroundColor = '#fff'
        el.style.borderColor = 'none'
        el.innerHTML = '<div id="x-gmail-root"></div>'
        ReactDOM.render(<GmailToolbarButton composeView={composeView} sdk={sdk} />, document.querySelector('#x-gmail-root'))
        composeView.on('minimized', () => {
          event.dropdown.close()
        })
      }
    })
    setTimeout(() => {
      const icon = document.querySelector('.inboxsdk__composeButton[data-group-order-hint="<appId>"]')
      icon.querySelector('.inboxsdk__button_icon').style.opacity = 1
    }, 1000)
  })
})

however, while debugging, I saw this error on my gmail console

Error logged: Error: Failed to find nav item
    at xt (contentScript.js:92:24293)
    at contentScript.js:127:95741 

Original error stack:
Error: Failed to find nav item
    at xt (chrome-extension://iinfjdloicbbgbdliglpofadahlmgjop/contentScript.js:92:24293)
    at chrome-extension://iinfjdloicbbgbdliglpofadahlmgjop/contentScript.js:127:95741 

Error logged from:
    at _ (chrome-extension://iinfjdloicbbgbdliglpofadahlmgjop/contentScript.js:36:6535)
    at A.error (chrome-extension://iinfjdloicbbgbdliglpofadahlmgjop/contentScript.js:36:5344)
    at xt (chrome-extension://iinfjdloicbbgbdliglpofadahlmgjop/contentScript.js:92:24287)
    at chrome-extension://iinfjdloicbbgbdliglpofadahlmgjop/contentScript.js:127:95741 

Extension App Ids: [
  {
    "appId": "<appId>"
  }
] 
Sent by App: false 
Session Id: 1703233143579-0.3676635904676302 
Extension Id: chrome-extension://iinfjdloicbbgbdliglpofadahlmgjop/ 
InboxSDK Loader Version: 0.7.25-1687968399204-48804bef199f3cee 
InboxSDK Implementation Version: 0.7.25-1687968399204-48804bef199f3cee 
Is Using Sync API: true

I have not been able to make sense of that error.

Any idea on what to do or could this error be a point to something being wrong somewhere? Any help would be appreciated.

0

There are 0 answers