CR: fix ++ --> +=1
This commit is contained in:
@@ -86,13 +86,13 @@ export function useFileUpload({
|
|||||||
// Global drag events with counter for robust dragOver state
|
// Global drag events with counter for robust dragOver state
|
||||||
const handleWindowDragEnter = (e: DragEvent) => {
|
const handleWindowDragEnter = (e: DragEvent) => {
|
||||||
if (e.dataTransfer?.types?.includes("Files")) {
|
if (e.dataTransfer?.types?.includes("Files")) {
|
||||||
dragCounter.current++;
|
dragCounter.current += 1;
|
||||||
setDragOver(true);
|
setDragOver(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const handleWindowDragLeave = (e: DragEvent) => {
|
const handleWindowDragLeave = (e: DragEvent) => {
|
||||||
if (e.dataTransfer?.types?.includes("Files")) {
|
if (e.dataTransfer?.types?.includes("Files")) {
|
||||||
dragCounter.current--;
|
dragCounter.current -= 1;
|
||||||
if (dragCounter.current <= 0) {
|
if (dragCounter.current <= 0) {
|
||||||
setDragOver(false);
|
setDragOver(false);
|
||||||
dragCounter.current = 0;
|
dragCounter.current = 0;
|
||||||
@@ -204,7 +204,7 @@ export function useFileUpload({
|
|||||||
const items = e.clipboardData.items;
|
const items = e.clipboardData.items;
|
||||||
if (!items) return;
|
if (!items) return;
|
||||||
const files: File[] = [];
|
const files: File[] = [];
|
||||||
for (let i = 0; i < items.length; i++) {
|
for (let i = 0; i < items.length; i += 1) {
|
||||||
const item = items[i];
|
const item = items[i];
|
||||||
if (item.kind === "file") {
|
if (item.kind === "file") {
|
||||||
const file = item.getAsFile();
|
const file = item.getAsFile();
|
||||||
|
|||||||
Reference in New Issue
Block a user