fix: shuffle history couldn't go back more than once (#635)

* fix: shuffle history couldn't go back more than once

ref #631

---------

Co-authored-by: christoph-heinrich <christoph-heinrich@users.noreply.github.com>
This commit is contained in:
Tomas Klaen
2023-09-21 10:27:21 +02:00
committed by GitHub
parent 230112bde8
commit 7a4d687864
2 changed files with 26 additions and 7 deletions

View File

@@ -481,6 +481,9 @@ state = {
has_chapter = false,
has_playlist = false,
shuffle = options.shuffle,
---@type nil|{pos: number; paths: string[]}
shuffle_history = nil,
on_shuffle = function() state.shuffle_history = nil end,
mouse_bindings_enabled = false,
uncached_ranges = nil,
cache = nil,
@@ -607,6 +610,7 @@ end
function set_state(name, value)
state[name] = value
call_maybe(state['on_' .. name], value)
Elements:trigger('prop_' .. name, value)
end