Skip to content

Commit

Permalink
Fixes a bug with sorting names
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp committed Sep 19, 2024
1 parent 6130dff commit dac7964
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-planets-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vtbag/inspection-chamber': patch
---

Fixes a bug with name sorting
2 changes: 1 addition & 1 deletion src/animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export async function retrieveViewTransitionAnimations() {

initTwin(frameDoc, frameDoc, names, oldNames, newNames);

updateNames(names, oldNames, newNames);
updateNames(oldNames, newNames, names);
}

export function unleashAllAnimations() {
Expand Down
6 changes: 3 additions & 3 deletions src/panel/names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { mayViewTransition, vtActive } from './transition';
export const THROTTLING_DELAY = 500;

export function updateNames(
names: Set<string>,
leftTransitionNames: Set<string>,
rightTransitionNames?: Set<string>
rightTransitionNames?: Set<string>,
names?: Set<string>
) {
//navigator.clipboard.writeText("");
mayViewTransition(() => {
Expand All @@ -26,7 +26,7 @@ export function updateNames(
top!.document.querySelector<HTMLElement>('#vtbag-ui-names div')!.style.display =
rightTransitionNames ? 'flex' : 'none';
const list = top!.document.querySelector('#vtbag-ui-names > ol')!;
(rightTransitionNames ? names : [...names].sort()).forEach((name, idx) => {
(rightTransitionNames ? names! : [...leftTransitionNames].sort()).forEach((name, idx) => {
const li = top!.document.createElement('li');
li.innerText = name;
if (rightTransitionNames && leftTransitionNames.has(name)) {
Expand Down

0 comments on commit dac7964

Please sign in to comment.