Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tutor-shot-extension
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramdayal Munda
tutor-shot-extension
Commits
fc770615
Commit
fc770615
authored
Nov 15, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
close popup when recording starts
parent
3d0f3bca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
10 deletions
+1
-10
popup.js
popup.js
+1
-10
No files found.
popup.js
View file @
fc770615
!
function
()
{
!
function
()
{
const
origin
=
"http://localhost:3039"
const
origin
=
"http://localhost:3039"
console
.
log
(
'popup'
,
chrome
);
const
api
=
axios
.
create
({
const
api
=
axios
.
create
({
baseURL
:
`
${
origin
}
/api`
,
// the base URL for nodeserver is okay but NGINX is giving error
baseURL
:
`
${
origin
}
/api`
,
// the base URL for nodeserver is okay but NGINX is giving error
...
@@ -28,23 +27,17 @@
...
@@ -28,23 +27,17 @@
startBtn
.
addEventListener
(
'click'
,
async
function
()
{
startBtn
.
addEventListener
(
'click'
,
async
function
()
{
if
(
inProgress
){
if
(
inProgress
){
console
.
log
(
'something in progress'
);
return
return
}
}
inProgress
=
true
inProgress
=
true
try
{
try
{
let
{
data
}
=
await
api
.
post
(
'/tutor-shot'
,
{
title
:
"Some random title"
},
{
headers
:
{
userId
:
userDetails
.
uid
}
}
)
let
{
data
}
=
await
api
.
post
(
'/tutor-shot'
,
{
title
:
"Some random title"
},
{
headers
:
{
userId
:
userDetails
.
uid
}
}
)
console
.
log
(
'creating reponse'
,
data
)
if
(
data
.
success
){
if
(
data
.
success
){
chrome
.
runtime
.
sendMessage
({
action
:
"startRecording"
,
tutorShotId
:
data
.
tutorShot
.
_id
},
async
function
(
response
)
{
chrome
.
runtime
.
sendMessage
({
action
:
"startRecording"
,
tutorShotId
:
data
.
tutorShot
.
_id
},
async
function
(
response
)
{
recording
=
response
.
recording
recording
=
response
.
recording
console
.
log
(
'to start. we need api'
,
api
)
modifyPopupUI
()
modifyPopupUI
()
inProgress
=
false
inProgress
=
false
window
.
close
()
})
})
}
}
}
catch
(
err
){
}
catch
(
err
){
...
@@ -56,7 +49,6 @@
...
@@ -56,7 +49,6 @@
stopBtn
.
addEventListener
(
'click'
,
function
()
{
stopBtn
.
addEventListener
(
'click'
,
function
()
{
if
(
inProgress
){
if
(
inProgress
){
console
.
log
(
'something in progress'
);
return
return
}
}
inProgress
=
true
inProgress
=
true
...
@@ -68,7 +60,6 @@
...
@@ -68,7 +60,6 @@
})
})
function
modifyPopupUI
()
{
function
modifyPopupUI
()
{
console
.
log
(
'modify ui'
,
userDetails
)
loginBtn
.
style
.
display
=
loggedIn
?
'none'
:
''
loginBtn
.
style
.
display
=
loggedIn
?
'none'
:
''
startBtn
.
style
.
display
=
loggedIn
?
(
recording
?
'none'
:
''
)
:
'none'
startBtn
.
style
.
display
=
loggedIn
?
(
recording
?
'none'
:
''
)
:
'none'
stopBtn
.
style
.
display
=
loggedIn
?
(
!
recording
?
'none'
:
''
)
:
'none'
stopBtn
.
style
.
display
=
loggedIn
?
(
!
recording
?
'none'
:
''
)
:
'none'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment