fix(admin): resolve 500 on missing product update and add direct image URL & paste support
Deploy Canina / deploy (push) Has been cancelled
Deploy Canina / deploy (push) Has been cancelled
This commit is contained in:
1 parent
a3291cc468
commit
9c8286c63f
3 files changed
+63
-14
No files matched your search
@@ -36,6 +36,17 @@ export default function MediaSelector({ isOpen, onClose, onSelect, multiple = fa
|
||||
if (!isOpen) return;
|
||||
|
||||
const handlePaste = (e: ClipboardEvent) => {
|
||||
const clipboardText = e.clipboardData?.getData('text');
|
||||
if (clipboardText && (clipboardText.startsWith('http://') || clipboardText.startsWith('https://'))) {
|
||||
e.preventDefault();
|
||||
setPasteStatus('لینک تصویر چسبانده شد!');
|
||||
onSelect(clipboardText);
|
||||
if (!multiple) onClose();
|
||||
if (pasteTimerRef.current) clearTimeout(pasteTimerRef.current);
|
||||
pasteTimerRef.current = setTimeout(() => setPasteStatus(null), 3000);
|
||||
return;
|
||||
}
|
||||
|
||||
const items = e.clipboardData?.items;
|
||||
if (!items) return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user