This commit is contained in:
Reece 2025-10-08 12:26:34 +01:00
parent 23f85d7267
commit fa6e01b46e
3 changed files with 2 additions and 22 deletions

View File

@ -124,11 +124,6 @@ function FileContextInner({
baseActions.unpinFile(file.fileId);
}, [baseActions]);
// Refresh file context - triggers re-render of file-dependent components
const refreshFileContext = useCallback(() => {
dispatch({ type: 'REFRESH_CONTEXT' });
}, []);
// Complete actions object
const actions = useMemo<FileContextActions>(() => ({
...baseActions,
@ -175,7 +170,6 @@ function FileContextInner({
}
}
},
refreshFileContext,
// Pinned files functionality with File object wrappers
pinFile: pinFileWrapper,
unpinFile: unpinFileWrapper,
@ -197,8 +191,7 @@ function FileContextInner({
pinFileWrapper,
unpinFileWrapper,
indexedDB,
enablePersistence,
refreshFileContext
enablePersistence
]);
// Split context values to minimize re-renders

View File

@ -283,17 +283,6 @@ export function fileContextReducer(state: FileContextState, action: FileContextA
return { ...initialFileContextState };
}
case 'REFRESH_CONTEXT': {
// Trigger re-render by returning new state object while preserving data
// This forces components to reload without losing file data
return {
...state,
ui: {
...state.ui
}
};
}
default:
return state;
}

View File

@ -250,8 +250,7 @@ export type FileContextAction =
| { type: 'SET_UNSAVED_CHANGES'; payload: { hasChanges: boolean } }
// Context management
| { type: 'RESET_CONTEXT' }
| { type: 'REFRESH_CONTEXT' };
| { type: 'RESET_CONTEXT' };
export interface FileContextActions {
// File management - lightweight actions only
@ -286,7 +285,6 @@ export interface FileContextActions {
// Context management
resetContext: () => void;
refreshFileContext: () => void;
// Resource management
trackBlobUrl: (url: string) => void;