diff --git a/src-tauri/yaak-git/src/git.rs b/src-tauri/yaak-git/src/git.rs index 1ac36682..9f678484 100644 --- a/src-tauri/yaak-git/src/git.rs +++ b/src-tauri/yaak-git/src/git.rs @@ -265,7 +265,7 @@ pub fn git_status(dir: &Path) -> Result { None => None, Some(t) => match t.get_path(&Path::new(&rela_path)) { Ok(entry) => { - let obj = entry.to_object(&repo).unwrap(); + let obj = entry.to_object(&repo)?; let content = obj.as_blob().unwrap().content(); let name = Path::new(entry.name().unwrap_or_default()); SyncModel::from_bytes(content.into(), name)?.map(|m| m.0) diff --git a/src-web/components/sidebar/Sidebar.tsx b/src-web/components/sidebar/Sidebar.tsx index b0821316..f045f27e 100644 --- a/src-web/components/sidebar/Sidebar.tsx +++ b/src-web/components/sidebar/Sidebar.tsx @@ -232,6 +232,7 @@ export function Sidebar({ className }: Props) { const handleEnd = useCallback( async (itemId) => { setHoveredTree(null); + setDraggingId(null); handleClearSelected(); if (hoveredTree == null || hoveredIndex == null) { @@ -278,9 +279,8 @@ export function Sidebar({ className }: Props) { ); } else { const sortPriority = afterPriority - (afterPriority - beforePriority) / 2; - return patchModelById(child.model, child.id, { sortPriority, folderId }); + await patchModelById(child.model, child.id, { sortPriority, folderId }); } - setDraggingId(null); }, [handleClearSelected, hoveredTree, hoveredIndex, treeParentMap], ); diff --git a/src-web/components/sidebar/SidebarAtoms.ts b/src-web/components/sidebar/SidebarAtoms.ts index f467f06e..b5ea06fe 100644 --- a/src-web/components/sidebar/SidebarAtoms.ts +++ b/src-web/components/sidebar/SidebarAtoms.ts @@ -6,7 +6,7 @@ import { type WebsocketRequest, } from '@yaakapp-internal/models'; -// This is an atom so we can use it in the child items to avoid re-rendering the entire list +// This is an atom, so we can use it in the child items to avoid re-rendering the entire list import { atom } from 'jotai'; import { activeWorkspaceAtom } from '../../hooks/useActiveWorkspace'; import { allRequestsAtom } from '../../hooks/useAllRequests';