minor optimziations

This commit is contained in:
ThaUnknown 2020-10-30 17:24:06 +01:00
parent 6f9515618f
commit e092fffe41
2 changed files with 3 additions and 3 deletions

View file

@ -99,7 +99,7 @@ async function dragBarStart() {
let currentTime;
function updateBar(progressPercent) {
if (document.location.href.endsWith("#player")) {
if (document.location.hash = "#player") {
currentTime = video.duration * progressPercent / 100
progress.style.setProperty("--progress", progressPercent + "%");
thumb.style.setProperty("--progress", progressPercent + "%");

View file

@ -76,7 +76,7 @@ async function addTorrent(magnet) {
client.torrents[0].destroy()
}
halfmoon.hideModal("tsearch")
document.location.href = "#player"
document.location.hash = "#player"
let selected = playerData.selected,
store
resetVideo()
@ -166,7 +166,7 @@ function postDownload(url, file) {
}
}
function onProgress() {
if (document.location.href.endsWith("#player") && client.torrents[0]) {
if (document.location.hash = "#player" && client.torrents[0]) {
player.style.setProperty("--download", client.torrents[0].progress * 100 + "%");
peers.textContent = client.torrents[0].numPeers
downSpeed.textContent = prettyBytes(client.torrents[0].downloadSpeed) + '/s'