Skip to content

Commit

Permalink
Improve share feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Xwilarg committed Jun 21, 2024
1 parent 02eab3f commit b6b3d83
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions web/src/getMusics.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ function loadPage() {
document.getElementById("share").addEventListener("click", (_) => {
const playlist = url.searchParams.get("playlist");
const newUrl = window.location.origin + window.location.pathname + `?playlist=${playlist}&song=${encodeURIComponent(`${currSong.name}_${currSong.artist}`)}`;
window.history.pushState({},"", newUrl);
navigator.share({url: newUrl});
});
document.getElementById("volume").addEventListener("change", (_) => {
player.volume = document.getElementById("volume").value / 100;
Expand Down Expand Up @@ -454,10 +454,6 @@ function lookForSong(url)
}
}

window.addEventListener("popstate", (e) => {
const url = new URL(window.location.href);
lookForSong(url);
});
// #endregion

// #region onclick events
Expand Down

0 comments on commit b6b3d83

Please sign in to comment.