mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-04-07 00:15:23 +02:00
clean the hook
This commit is contained in:
parent
597dec9340
commit
92fa9eece7
1 changed files with 5 additions and 3 deletions
|
|
@ -19,9 +19,11 @@ export default function useManualCopyToClipboard(
|
|||
|
||||
// Create a temporary container for the selected content
|
||||
const tempDiv = document.createElement('div');
|
||||
const range = selection.getRangeAt(0);
|
||||
const clonedSelection = range.cloneContents();
|
||||
tempDiv.appendChild(clonedSelection);
|
||||
const range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null;
|
||||
const clonedSelection = range ? range.cloneContents() : null;
|
||||
if (clonedSelection) {
|
||||
tempDiv.appendChild(clonedSelection);
|
||||
}
|
||||
|
||||
const stripInlineStyles = (element: Element) => {
|
||||
// Remove style attribute (the main culprit for bloat)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue