Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jensen
Project
Project
Details
Activity
Releases
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
Skye Yu
jensen
Commits
034fe900
Commit
034fe900
authored
Oct 23, 2024
by
Skye Yu
3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove setInterval
parent
d33ee3bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
6 deletions
+0
-6
jensen.js
src/jensen.js
+0
-6
No files found.
src/jensen.js
View file @
034fe900
...
...
@@ -705,7 +705,6 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
for
(
let
i
=
0
;
i
<
filename
.
length
;
i
++
)
fname
.
push
(
filename
.
charCodeAt
(
i
));
let
wakeLock
=
null
;
let
timer
=
null
;
function
visibilitychange
()
{
let
audio
=
document
.
getElementById
(
'test_audio'
);
if
(
!
audio
)
{
...
...
@@ -721,14 +720,10 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
if
(
document
.
visibilityState
===
'hidden'
)
{
console
.
log
(
'Page is hidden'
);
audio
.
play
();
timer
=
setInterval
(()
=>
{
console
.
log
(
"Keeping the page alive..."
);
},
1000
)
}
else
{
audio
.
pause
();
console
.
log
(
'Page is visible'
);
wakeLock
&&
wakeLock
.
release
();
timer
&&
clearInterval
(
timer
)
}
}
...
...
@@ -745,7 +740,6 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
const
audio
=
document
.
getElementById
(
'test_audio'
);
audio
&&
audio
.
pause
()
&&
audio
.
remove
();
wakeLock
&&
wakeLock
.
release
();
timer
&&
clearInterval
(
timer
)
console
.
log
(
'Clear event and task.'
);
}
...
...
Skye Yu
@skye
mentioned in commit
7899ad11
·
Oct 23, 2024
mentioned in commit
7899ad11
mentioned in commit 7899ad1113ac685333608310f55a51ce42d02b5f
Toggle commit list
Skye Yu
@skye
mentioned in merge request
!5 (merged)
·
Oct 23, 2024
mentioned in merge request
!5 (merged)
mentioned in merge request !5
Toggle commit list
Skye Yu
@skye
mentioned in commit
9f9d86f9
·
Oct 23, 2024
mentioned in commit
9f9d86f9
mentioned in commit 9f9d86f9c4ab48bd4c81c8720a5af7b01315e335
Toggle commit list
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