MVP Debugger UI (#2888)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { create } from "zustand";
|
||||
import { AxiosInstance } from "axios";
|
||||
import { lsKeys } from "@/util/env";
|
||||
|
||||
export interface BrowserSessionData {
|
||||
browser_session_id: string | null;
|
||||
@@ -10,7 +11,6 @@ interface OptimisticBrowserSessionIdState extends BrowserSessionData {
|
||||
run: (client: AxiosInstance) => Promise<BrowserSessionData>;
|
||||
}
|
||||
|
||||
const SESSION_KEY = "skyvern.optimisticBrowserSession";
|
||||
const SESSION_TIMEOUT_MINUTES = 60;
|
||||
|
||||
export const useOptimisticallyRequestBrowserSessionId =
|
||||
@@ -18,7 +18,7 @@ export const useOptimisticallyRequestBrowserSessionId =
|
||||
browser_session_id: null,
|
||||
expires_at: null,
|
||||
run: async (client) => {
|
||||
const stored = localStorage.getItem(SESSION_KEY);
|
||||
const stored = localStorage.getItem(lsKeys.optimisticBrowserSession);
|
||||
if (stored) {
|
||||
try {
|
||||
const parsed = JSON.parse(stored);
|
||||
@@ -50,7 +50,7 @@ export const useOptimisticallyRequestBrowserSessionId =
|
||||
expires_at: newExpiresAt,
|
||||
});
|
||||
localStorage.setItem(
|
||||
SESSION_KEY,
|
||||
lsKeys.optimisticBrowserSession,
|
||||
JSON.stringify({
|
||||
browser_session_id: newBrowserSessionId,
|
||||
expires_at: newExpiresAt,
|
||||
|
||||
Reference in New Issue
Block a user