mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 23:44:22 +00:00
Refactor workspace context usage to improve structure and introduce ThemeContext
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useCallback, useEffect } from 'react';
|
||||
import { useWorkspace } from '../contexts/WorkspaceContext';
|
||||
import { useWorkspaceData } from '../contexts/WorkspaceDataContext';
|
||||
import { useLastOpenedFile } from './useLastOpenedFile';
|
||||
import { DEFAULT_FILE } from '@/types/models';
|
||||
|
||||
@@ -12,7 +12,7 @@ interface UseFileNavigationResult {
|
||||
export const useFileNavigation = (): UseFileNavigationResult => {
|
||||
const [selectedFile, setSelectedFile] = useState<string>(DEFAULT_FILE.path);
|
||||
const [isNewFile, setIsNewFile] = useState<boolean>(true);
|
||||
const { currentWorkspace } = useWorkspace();
|
||||
const { currentWorkspace } = useWorkspaceData();
|
||||
const { loadLastOpenedFile, saveLastOpenedFile } = useLastOpenedFile();
|
||||
|
||||
const handleFileSelect = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user