File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ let currentLoopIdx = 0;
40
40
*/
41
41
function setMediaSession ( videoData ) {
42
42
if ( ! ( "mediaSession" in navigator ) ) {
43
- console . error ( "Browser doen 't support mediaSession" ) ;
43
+ console . error ( "Browser doesn 't support mediaSession" ) ;
44
44
return ;
45
45
}
46
46
navigator . mediaSession . metadata = new MediaMetadata ( {
@@ -131,7 +131,7 @@ function playPauseToggle() {
131
131
async function fetchMusic ( youtubeId ) {
132
132
playPauseToggleEl . innerHTML = playerButtonsIcons . loading ;
133
133
document . body . style . cursor = "progress" ;
134
- Utils . toggleLoading ( ) ;
134
+ Utils . showLoading ( ) ;
135
135
136
136
await fetch ( "/api/song/download/" + youtubeId )
137
137
. then ( ( res ) => console . log ( res ) )
@@ -218,7 +218,7 @@ audioPlayerEl.addEventListener("loadeddata", (event) => {
218
218
219
219
playPauseToggleEl . innerHTML = playerButtonsIcons . pause ;
220
220
document . body . style . cursor = "auto" ;
221
- Utils . toggleLoading ( ) ;
221
+ Utils . hideLoading ( ) ;
222
222
} ) ;
223
223
224
224
audioPlayerEl . addEventListener ( "timeupdate" , ( event ) => {
Original file line number Diff line number Diff line change 1
1
"use strict" ;
2
2
3
- function toggleLoading ( ) {
4
- if ( loadingEl . classList . contains ( "hidden" ) ) {
5
- loadingEl . classList . remove ( "hidden" ) ;
6
- } else {
7
- loadingEl . classList . add ( "hidden" ) ;
8
- }
3
+ function showLoading ( ) {
4
+ loadingEl . classList . remove ( "hidden" ) ;
5
+ }
6
+
7
+ function hideLoading ( ) {
8
+ loadingEl . classList . add ( "hidden" ) ;
9
9
}
10
10
11
11
/**
@@ -45,7 +45,8 @@ window.addEventListener("popstate", (e) => {
45
45
} ) ;
46
46
47
47
window . Utils = {
48
- toggleLoading,
48
+ showLoading,
49
+ hideLoading,
49
50
formatTime,
50
51
formatNumber,
51
52
getTextWidth,
Original file line number Diff line number Diff line change @@ -37,6 +37,6 @@ templ VerifyOtp() {
37
37
</div>
38
38
-->
39
39
<script >
40
- window .Utils .toggleLoading ();
40
+ window .Utils .hideLoading ();
41
41
</script >
42
42
}
You can’t perform that action at this time.
0 commit comments