Merge pull request #163 from 11cafe/fix/hover-check
fix: rm hover check
This commit is contained in:
@@ -9,7 +9,6 @@ import { Folder, Workflow } from "../types/dbTypes";
|
||||
import FilesListFolderItem from "./FilesListFolderItem";
|
||||
import WorkflowListItem from "./WorkflowListItem";
|
||||
import { Box } from "@chakra-ui/react";
|
||||
import { folderOnTopLocalStorageKey } from "./types";
|
||||
import { userSettingsTable } from "../db-tables/WorkspaceDB";
|
||||
|
||||
export default function ItemsList({
|
||||
@@ -26,20 +25,6 @@ export default function ItemsList({
|
||||
const { onRefreshFilesList, draggingFile, refreshFolderStamp } =
|
||||
useContext(RecentFilesContext);
|
||||
|
||||
const handleDragLeave = (e: DragEvent) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const targetIsDroppable =
|
||||
e.relatedTarget instanceof Element &&
|
||||
e.relatedTarget.classList.contains("droppable") &&
|
||||
e.relatedTarget !== e.currentTarget;
|
||||
const targetIsChild = e.currentTarget.contains(e.relatedTarget as Node);
|
||||
// fixes a bug where the dragleave event is fired when dragging over a child element, causing elements to flicker
|
||||
if (targetIsDroppable || !targetIsChild) {
|
||||
setIsDraggingOver(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleDrop = async (e: DragEvent) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
@@ -72,13 +57,19 @@ export default function ItemsList({
|
||||
<FilesListFolderItem key={folder.id} folder={folder} />
|
||||
))}
|
||||
<Box
|
||||
border={isDraggingOver ? "2px dashed #718096" : undefined}
|
||||
border={
|
||||
isDraggingOver ? "2px dashed #718096" : "2px dashed transparent"
|
||||
}
|
||||
onDragOver={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setIsDraggingOver(true);
|
||||
}}
|
||||
onDragLeave={handleDragLeave}
|
||||
onDragLeave={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setIsDraggingOver(false);
|
||||
}}
|
||||
onDrop={handleDrop}
|
||||
className="droppable"
|
||||
>
|
||||
|
||||
@@ -49,9 +49,9 @@ export class FoldersTable extends TableBase<Folder> {
|
||||
if (folder == null) {
|
||||
return;
|
||||
}
|
||||
const nameChanged = input.name != undefined && input.name != folder.name;
|
||||
const nameChanged = "name" in input && input.name != folder.name;
|
||||
const parentFolderChanged =
|
||||
input.parentFolderID != undefined &&
|
||||
"parentFolderID" in input &&
|
||||
input.parentFolderID != folder.parentFolderID;
|
||||
const newRecord = {
|
||||
...folder,
|
||||
|
||||
@@ -157,7 +157,6 @@ export async function validateOrSaveAllJsonFileMyWorkflows(
|
||||
for (const workflow of flowList) {
|
||||
const fullPath = await generateFilePathAbsolute(workflow);
|
||||
if (workflow.filePath != fullPath) {
|
||||
console.log(workflow.filePath, fullPath);
|
||||
// file path changed
|
||||
workflow.filePath != null &&
|
||||
(await deleteFile(workflow.filePath, deleteEmptyFolder));
|
||||
|
||||
Reference in New Issue
Block a user