mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 10:34:06 +02:00
Fix/desktop open with tool access (#6056)
## Description Fixes #6029 - Additional selection in windows client no longer necessary ## Problem When opening PDF files in the Windows desktop client using "Open with", the file displays properly but users had to manually select it again in the workbench before any PDF tools (merge, compress, crop, compare, etc.) become functional. ## Root Cause Files opened via "Open with" were added to FileContext but **not selected** (missing `selectFiles: true`). Without selection, the file wasn't marked as active, preventing tool access. Additionally, `AppInitializer` was placed outside `ToolWorkflowProvider`, causing a context error. ## Solution ### Changes: 1. **frontend/src/desktop/hooks/useAppInitialization.ts** - Added `{ selectFiles: true }` when calling `addFiles()` - Files now immediately marked as active in FileContext 2. **frontend/src/core/components/AppProviders.tsx** - Moved `AppInitializer` inside `ToolWorkflowProvider` - Ensures context availability for initialization ## Testing - Open PDF via "Open with" on Windows - File now immediately usable with all tools - No manual reselection needed ## Screenshot <img width="1920" height="1080" alt="Screenshot (3)" src="https://github.com/user-attachments/assets/9ceacadf-eb12-42a6-86f9-bca6188bfbb9" /> --------- Co-authored-by: Anthony Stirling <[email protected]> Co-authored-by: EthanHealy01 <[email protected]> Co-authored-by: Reece Browne <[email protected]>
This commit is contained in:
co-authored by
Anthony Stirling
EthanHealy01
Reece Browne
parent
ebab5a4456
commit
fbae819d7c
@@ -59,7 +59,7 @@ export function useAppInitialization(): void {
|
||||
const filesArray = loadedFiles.map(entry => entry.file);
|
||||
const quickKeyToPath = new Map(loadedFiles.map(entry => [entry.quickKey, entry.filePath]));
|
||||
|
||||
const addedFiles = await addFiles(filesArray);
|
||||
const addedFiles = await addFiles(filesArray, { selectFiles: true });
|
||||
addedFiles.forEach(file => {
|
||||
const localFilePath = quickKeyToPath.get(file.quickKey);
|
||||
if (localFilePath) {
|
||||
|
||||
Reference in New Issue
Block a user