restore WB snapshot image download

This commit is contained in:
KDSBrowne 2022-06-17 19:10:23 +00:00
parent 8df5e3de02
commit 3b44d17417

View File

@ -185,33 +185,41 @@ const PresentationMenu = (props) => {
},
});
toPng(getScreenshotRef(), {
width: window.screen.width,
height: window.screen.height,
}).then((data) => {
const anchor = document.createElement('a');
anchor.href = data;
anchor.setAttribute(
'download',
`${elementName}_${meetingName}_${new Date().toISOString()}.png`,
);
anchor.click();
try {
const wbRef = document.getElementById('Navbar')?.nextSibling?.childNodes[1]?.querySelector('[tabindex = "0"]');
toPng(wbRef, {
width: window.screen.width,
height: window.screen.height,
}).then((data) => {
const anchor = document.createElement('a');
anchor.href = data;
anchor.setAttribute(
'download',
`${elementName}_${meetingName}_${new Date().toISOString()}.png`,
);
anchor.click();
setState({
loading: false,
hasError: false,
setState({
loading: false,
hasError: false,
});
}).catch((error) => {
logger.warn({
logCode: 'presentation_snapshot_error',
extraInfo: error,
});
setState({
loading: false,
hasError: true,
});
});
}).catch((error) => {
} catch (err) {
logger.warn({
logCode: 'presentation_snapshot_error',
extraInfo: error,
extraInfo: err,
});
setState({
loading: false,
hasError: true,
});
});
}
},
},
);