Skip to content

Commit

Permalink
Fix selection created on videos page refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
probablykasper committed Jan 28, 2024
1 parent f76926b commit 3f8ed87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Next
- Fix selection being created on videos page refresh

## 1.7.0 - 2024 Jan 21
- Add basic history page, accessible via `Cmd/Ctrl+Y`.
- Fix selection staying in the same position when videos update
Expand Down
5 changes: 2 additions & 3 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@
// Update the selection index if the video moves
const newSelectedIndex = videos.findIndex((v) => v.id === selectedId)
if (newSelectedIndex >= 0) {
if (newSelectedIndex >= 0 && selectionVisible) {
selectedIndex = newSelectedIndex
selectionVisible = true
} else {
// Or clear selection if the video disappeared from view
selectedIndex = 0
selectionVisible = false
}
const selectionMoved = selectionVisible && selectedIndex !== oldselectedIndex
const selectionMoved = selectedIndex !== oldselectedIndex && selectionVisible
if (selectionMoved) {
allowScrollToBox = false
Expand Down

0 comments on commit 3f8ed87

Please sign in to comment.