Fix race condition in generating next/previous page references when using transparent mode. (#1456)
This commit is contained in:
parent
f8c6ea2b00
commit
22c29fe936
|
@ -313,6 +313,13 @@ impl Library {
|
|||
}
|
||||
|
||||
for (key, (sorted, cannot_be_sorted, sort_by)) in updates {
|
||||
let section_is_transparent = if let Some(section) = self.sections.get(key) {
|
||||
section.meta.transparent
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
||||
if !section_is_transparent {
|
||||
// Find sibling between sorted pages first
|
||||
let with_siblings = find_siblings(&sorted);
|
||||
|
||||
|
@ -335,12 +342,15 @@ impl Library {
|
|||
page.lighter = val1;
|
||||
page.heavier = val2;
|
||||
}
|
||||
SortBy::None => unreachable!("Impossible to find siblings in SortBy::None"),
|
||||
SortBy::None => {
|
||||
unreachable!("Impossible to find siblings in SortBy::None")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
unreachable!("Sorting got an unknown page")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(s) = self.sections.get_mut(key) {
|
||||
s.pages = sorted;
|
||||
|
|
Loading…
Reference in a new issue