Skip to content

Commit 35beb8b

Browse files
committed
Fix profile card re-arrange animation being played when the manager is opened
1 parent ddc4526 commit 35beb8b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/entries/manager/components/profilelist/ProfileList.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ function scrollTo(node: HTMLElement, scrollTo: boolean) {
138138
{#each profilesDisplay as profile (profile.id)}
139139
<!-- <div transition:slide|local={{delay: 250}}>-->
140140
<!-- <div animate:flip={{duration:flipDurationMs}} transition:scale|local={{delay: 250}}>-->
141-
<!-- TODO: Fix flip animation playing when manager is first opened -->
142141
<!-- TODO: Bring back transition using custom code: https://svelte.dev/repl/3f1e68203ef140969a8240eba3475a8d?version=3.55.1 -->
143142
<div animate:flip={{duration:flipDurationMs}} use:scrollTo={profile.id === $newProfileEvent}>
144143
<ProfileCard {profile}

src/lib/common.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ const unsortedProfileListStore: Readable<ProfileList | null> = storageKeyStore('
4444
export const profileListStore: Readable<ProfileList | null> = derived(
4545
[unsortedProfileListStore, profileOrderStore],
4646
([profileList, profileOrder]) => {
47-
if(profileList == null) {
47+
// Only produce result when both profile list store and profile order store are ready
48+
// This prevents animations from playing when the ProfileList first starts up
49+
if(profileList == null || profileOrder == null) {
4850
return null;
4951
} else {
50-
if(profileOrder == null)
51-
profileOrder = [];
52-
5352
const lookup = {};
5453
profileOrder.forEach((id, idx) => {
5554
lookup[id] = idx;

0 commit comments

Comments
 (0)