fix: recover cursor logic (#773)

This commit is contained in:
Carlos Valente
2024-02-13 18:43:41 +01:00
committed by GitHub
parent 67c448572c
commit 71dace669b
12 changed files with 59 additions and 38 deletions
@@ -17,8 +17,9 @@ function persistModeToSession(mode: AppMode) {
type AppModeStore = {
mode: AppMode;
cursor: string | null;
setMode: (mode: AppMode) => void;
cursor: string | null;
setCursor: (cursor: string | null) => void;
};
export const useAppMode = create<AppModeStore>()((set) => ({
@@ -31,4 +32,5 @@ export const useAppMode = create<AppModeStore>()((set) => ({
return { mode };
});
},
setCursor: (cursor: string | null) => set(() => ({ cursor })),
}));