Commit fc770615 by ramdayalmunda

close popup when recording starts

parent 3d0f3bca
!function () {
const origin = "http://localhost:3039"
console.log('popup', chrome);
const api = axios.create({
baseURL: `${origin}/api`, // the base URL for nodeserver is okay but NGINX is giving error
......@@ -28,23 +27,17 @@
startBtn.addEventListener('click', async function () {
if (inProgress){
console.log('something in progress');
return
}
inProgress = true
try{
let { data } = await api.post('/tutor-shot', { title: "Some random title" }, { headers: { userId: userDetails.uid } } )
console.log('creating reponse',data)
if (data.success){
chrome.runtime.sendMessage({ action: "startRecording", tutorShotId:data.tutorShot._id }, async function (response) {
recording = response.recording
console.log('to start. we need api', api)
modifyPopupUI()
inProgress = false
window.close()
})
}
}catch(err){
......@@ -56,7 +49,6 @@
stopBtn.addEventListener('click', function () {
if (inProgress){
console.log('something in progress');
return
}
inProgress = true
......@@ -68,7 +60,6 @@
})
function modifyPopupUI() {
console.log('modify ui', userDetails)
loginBtn.style.display = loggedIn ? 'none' : ''
startBtn.style.display = loggedIn ? (recording ? 'none' : '') : 'none'
stopBtn.style.display = loggedIn ? (!recording ? 'none' : '') : 'none'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment