mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-07 16:34:26 +00:00
Refactor workspace context usage to improve structure and introduce ThemeContext
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user