mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Upgrade javascript libraries (#516)
* Bump react-bootstrap * Bump library versions and clean up hooks * Bump intl libraries * Fix image pasting
This commit is contained in:
@@ -25,13 +25,18 @@ const onImageChange = (
|
||||
if (file) readImage(file, onLoadEnd);
|
||||
};
|
||||
|
||||
const usePasteImage = (onLoadEnd: (this: FileReader) => void) => {
|
||||
const usePasteImage = (
|
||||
onLoadEnd: (this: FileReader) => void,
|
||||
isActive: boolean = true
|
||||
) => {
|
||||
useEffect(() => {
|
||||
const paste = (event: ClipboardEvent) => pasteImage(event, onLoadEnd);
|
||||
document.addEventListener("paste", paste);
|
||||
if (isActive) {
|
||||
document.addEventListener("paste", paste);
|
||||
}
|
||||
|
||||
return () => document.removeEventListener("paste", paste);
|
||||
});
|
||||
}, [isActive, onLoadEnd]);
|
||||
};
|
||||
|
||||
const Image = {
|
||||
|
||||
Reference in New Issue
Block a user