diff --git a/src/api/recording.ts b/src/api/recording.ts index 6b816001..ce07753a 100644 --- a/src/api/recording.ts +++ b/src/api/recording.ts @@ -35,6 +35,19 @@ export const getActiveBrowserId = async(): Promise => { } }; +export const canCreateBrowserInState = async(state: "recording" | "run"): Promise => { + try { + const response = await axios.get(`${apiUrl}/record/can-create/${state}`, { withCredentials: true }); + if (response.status === 200) { + return response.data.canCreate; + } else { + return false; + } + } catch(error: any) { + return false; + } +}; + export const interpretCurrentRecording = async(): Promise => { try { const response = await axios.get(`${apiUrl}/record/interpret`);