mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 17:13:58 +01:00
remove image resizing for mobile chat download
This commit is contained in:
parent
d00984ba81
commit
94d5ad3692
|
@ -28,10 +28,13 @@ export const isChats = (chats: any): chats is ChatInterface[] => {
|
|||
};
|
||||
|
||||
export const htmlToImg = async (html: HTMLDivElement) => {
|
||||
const needResize = window.innerWidth >= 1024;
|
||||
const initialWidth = html.style.width;
|
||||
html.style.width = '1023px';
|
||||
if (needResize) {
|
||||
html.style.width = '1023px';
|
||||
}
|
||||
const canvas = await html2canvas(html);
|
||||
html.style.width = initialWidth;
|
||||
if (needResize) html.style.width = initialWidth;
|
||||
const dataURL = canvas.toDataURL('image/png');
|
||||
return dataURL;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue