dylanebert HF staff commited on
Commit
4384703
1 Parent(s): ab77dc3

restore scroll position

Browse files
Files changed (1) hide show
  1. src/routes/Vote.svelte +2 -0
src/routes/Vote.svelte CHANGED
@@ -69,6 +69,7 @@
69
  }
70
 
71
  async function loadScenes() {
 
72
  const success = await fetchScenes();
73
  if (!success) return;
74
 
@@ -97,6 +98,7 @@
97
 
98
  overlayA.style.display = "none";
99
  overlayB.style.display = "none";
 
100
  }
101
 
102
  async function vote(option: "A" | "B") {
 
69
  }
70
 
71
  async function loadScenes() {
72
+ const scrollPosition = window.scrollY;
73
  const success = await fetchScenes();
74
  if (!success) return;
75
 
 
98
 
99
  overlayA.style.display = "none";
100
  overlayB.style.display = "none";
101
+ window.scrollTo(0, scrollPosition);
102
  }
103
 
104
  async function vote(option: "A" | "B") {