Files
Dorod-Sky/skyvern-frontend/src/store/SettingsStore.ts

37 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-04-01 21:34:52 +03:00
import { create } from "zustand";
type SettingsStore = {
environment: string;
2025-11-28 11:23:06 -05:00
/**
* The user is currently operating or viewing a live, remote browser. NOTE: if
* the browser is still connecting, or otherwise not ready, then this should
* be false.
*/
isUsingABrowser: boolean;
/**
* The current browser session ID when a browser is active.
*/
browserSessionId: string | null;
2024-04-01 21:34:52 +03:00
organization: string;
setEnvironment: (environment: string) => void;
2025-11-28 11:23:06 -05:00
setIsUsingABrowser: (isUsing: boolean) => void;
setBrowserSessionId: (browserSessionId: string | null) => void;
2024-04-01 21:34:52 +03:00
setOrganization: (organization: string) => void;
};
const useSettingsStore = create<SettingsStore>((set) => {
return {
environment: "local",
2025-11-28 11:23:06 -05:00
isUsingABrowser: false,
browserSessionId: null,
2024-04-01 21:34:52 +03:00
organization: "skyvern",
setEnvironment: (environment: string) => set({ environment }),
2025-11-28 11:23:06 -05:00
setIsUsingABrowser: (isUsing: boolean) => set({ isUsingABrowser: isUsing }),
setBrowserSessionId: (browserSessionId: string | null) =>
set({ browserSessionId }),
2024-04-01 21:34:52 +03:00
setOrganization: (organization: string) => set({ organization }),
};
});
export { useSettingsStore };