File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/components/ChannelList/hooks Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,11 @@ export const useChannelListShapeDefaults = <SCG extends ExtendableGenerics>() =>
285285 const considerPinnedChannels = shouldConsiderPinnedChannels ( sort ) ;
286286 const considerArchivedChannels = shouldConsiderArchivedChannels ( filters ) ;
287287
288+ // `pinned_at` nor `archived` properties are set or channel list order is locked, return early
289+ if ( ( ! considerPinnedChannels && ! considerArchivedChannels ) || lockChannelOrder ) {
290+ return ;
291+ }
292+
288293 const pinnedAtSort = extractSortValue ( { atIndex : 0 , sort, targetKey : 'pinned_at' } ) ;
289294
290295 setChannels ( ( currentChannels ) => {
@@ -296,9 +301,6 @@ export const useChannelListShapeDefaults = <SCG extends ExtendableGenerics>() =>
296301 const isTargetChannelArchived = isChannelArchived ( targetChannel ) ;
297302 const isTargetChannelPinned = isChannelPinned ( targetChannel ) ;
298303
299- // handle pinning
300- if ( ! considerPinnedChannels || lockChannelOrder ) return currentChannels ;
301-
302304 const newChannels = [ ...currentChannels ] ;
303305
304306 if ( targetChannelExistsWithinList ) {
You can’t perform that action at this time.
0 commit comments