File tree Expand file tree Collapse file tree 3 files changed +20
-10
lines changed
Expand file tree Collapse file tree 3 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 100100 {/if }
101101
102102 {#if group .type === " Pinned" }
103- <Droppable id =" pinned-channels" class =" space-y-1.5" >
104- {#each group .channels as channel , i (channel .user .id )}
105- <Draggable id ={channel .id } index ={i } {channel } />
106- {/each }
107- </Droppable >
103+ {#key settings .state .pinned .length }
104+ <Droppable id =" pinned-channels" class =" space-y-1.5" >
105+ {#each group .channels as channel , i (channel .user .id )}
106+ <Draggable {channel } index ={i } />
107+ {/each }
108+ </Droppable >
109+ {/ key }
108110 {:else }
109111 {#each group .channels as channel (channel .user .id )}
110112 <div class ="px-1.5" animate:flip ={{ duration : 500 }}>
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { useSortable } from " @dnd-kit-svelte/svelte/sortable" ;
3- import type { UseSortableInput } from " @dnd-kit-svelte/svelte/sortable " ;
3+ import type { Channel } from " $lib/models/channel.svelte " ;
44 import ChannelListItem from " ./ChannelListItem.svelte" ;
55 import StreamTooltip from " ./StreamTooltip.svelte" ;
6- import type { ChannelListItemProps } from " ./ChannelListItem.svelte" ;
76
8- const { channel, ... rest }: UseSortableInput & ChannelListItemProps = $props ();
7+ interface Props {
8+ channel: Channel ;
9+ index: number ;
10+ }
911
10- const { ref, isDragging } = useSortable (rest );
12+ const { channel, index }: Props = $props ();
13+
14+ const { ref, isDragging } = useSortable ({
15+ id : () => channel .id ,
16+ index : () => index ,
17+ });
1118 </script >
1219
1320<div class ="relative px-1.5" {@attach ref }>
Original file line number Diff line number Diff line change 2424 <a
2525 class =" absolute inset-0 z-10"
2626 href ="/channels/ {channel .user .username }"
27- data-sveltekit-preload-data = " off "
27+ draggable = " false "
2828 aria-label ="Join {channel .user .displayName }"
29+ data-sveltekit-preload-data =" off"
2930 >
3031 </a >
3132
You can’t perform that action at this time.
0 commit comments