Skip to content

Commit

Permalink
fix: dont auto play when torrent menu is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaUnknown committed Apr 4, 2024
1 parent 5d41354 commit 0433d02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion common/views/TorrentSearch/TorrentMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
/** @param {ReturnType<typeof getBest>} promise */
async function autoPlay (promise, autoPlay) {
const best = await promise
if (!search) return
if ($settings.rssAutoplay) {
clearTimeout(timeoutHandle)
const decrement = () => {
Expand All @@ -73,7 +74,10 @@
$: lookup = sortResults(getResultsFromExtensions({ ...search, batch, movie, resolution }))
$: best = getBest(lookup)
onDestroy(() => clearTimeout(timeoutHandle))
onDestroy(() => {
clearTimeout(timeoutHandle)
search = null
})
$: if (!$settings.rssAutoplay) clearTimeout(timeoutHandle)
$: autoPlay(best, $settings.rssAutoplay)
Expand Down

0 comments on commit 0433d02

Please sign in to comment.