Skip to content

Commit

Permalink
Fix drag working in dev & prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocky43007 committed Feb 2, 2025
1 parent 0a7508c commit d4275ba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/src/drag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static TRACKING: AtomicBool = AtomicBool::new(false);
/// * `window` - The Tauri window instance
/// * `_state` - Current drag state (unused)
/// * `files` - Vector of file paths to be dragged
/// * `icon_path` - Path to the preview icon for the drag operation
/// * `image` - Base64 encoded image to be used as drag icon
/// * `on_event` - Channel for communicating drag operation events back to the frontend
#[tauri::command(async)]
#[specta::specta]
Expand Down
4 changes: 3 additions & 1 deletion apps/desktop/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ function useDragAndDrop() {
explorerStore.drag = null;
};

const image = !Transparent.includes('/@fs/') ? Transparent : Transparent.replace('/@fs', '');

await invoke('start_drag', {
files: validFiles,
image: Transparent,
image: image,
onEvent: channel
});
console.log('start_drag invoked successfully');
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/commands.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d4275ba

Please sign in to comment.