feat: get current tabs

This commit is contained in:
karishmas6
2024-06-09 01:07:37 +05:30
parent 823a708c27
commit 8b82414345

View File

@@ -78,4 +78,16 @@ export const getCurrentUrl = async (): Promise<string | null> => {
}
};
export const getCurrentTabs = async (): Promise<string[] | null> => {
try {
const response = await axios.get('http://localhost:8080/record/active/tabs');
if (response.status === 200) {
return response.data;
} else {
throw new Error('Couldn\'t retrieve stored recordings');
}
} catch(error: any) {
console.log(error);
return null;
}
};