Zoom Component View not setting default view as gallery, no errors. Opens in ribbon view

Awesome I appreciate you, yeah in the update I think a week ago the api is supposed to allow us to set the default view, but thank you I was able to get the following code to work based off the example you gave if anybody needs the “actual” (this is the solution), but the solution for the gallery view in particular I’ll include my code:

  client.on('connection-change', (e) => {
    if (e.state == 'Connected') {
      return new Promise((resolve, reject) => {
        let ribbon = document.querySelector('button[title="Ribbon"]');
  
        if (ribbon) {
          ribbon.click();
          console.log('-- switching to galleryview --');
  
          return resolve(true);
        }
  
        return reject(true);
      }).then((r) => {
        let xpath = "//span[text()='Gallery']";
        let galleryView = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  
        if (galleryView && galleryView.singleNodeValue) {
          galleryView.singleNodeValue.click();
        }
      }).catch((error) => {
        console.log('--- error when switching to gallery view --> ', error);
      });
    }
  });}
1 Like