Refactor workspace context usage to improve structure and introduce ThemeContext

This commit is contained in:
2025-05-25 12:11:03 +02:00
parent 6cf118280a
commit a724bc44e9
20 changed files with 381 additions and 252 deletions

View File

@@ -1,6 +1,6 @@
import { useCallback } from 'react';
import { getLastOpenedFile, updateLastOpenedFile } from '../api/file';
import { useWorkspace } from '../contexts/WorkspaceContext';
import { useWorkspaceData } from '../contexts/WorkspaceDataContext';
interface UseLastOpenedFileResult {
loadLastOpenedFile: () => Promise<string | null>;
@@ -8,7 +8,7 @@ interface UseLastOpenedFileResult {
}
export const useLastOpenedFile = (): UseLastOpenedFileResult => {
const { currentWorkspace } = useWorkspace();
const { currentWorkspace } = useWorkspaceData();
const loadLastOpenedFile = useCallback(async (): Promise<string | null> => {
if (!currentWorkspace) return null;