Saleor 1662 sort just added channel availability (#878)
* Sort channels on ProductUpdate * Update sorting channels after refactor * Sort channels on every view
This commit is contained in:
parent
07f8f4b0b8
commit
b16206dfa8
1 changed files with 4 additions and 1 deletions
|
@ -23,7 +23,10 @@ function useChannels<T extends Channel>(channels: T[]) {
|
||||||
const handleChannelsModalOpen = () => setChannelsModalOpen(true);
|
const handleChannelsModalOpen = () => setChannelsModalOpen(true);
|
||||||
|
|
||||||
const handleChannelsConfirm = () => {
|
const handleChannelsConfirm = () => {
|
||||||
setCurrentChannels(channelListElements);
|
const sortedChannelListElements = channelListElements.sort(
|
||||||
|
(channel, nextChannel) => channel.name.localeCompare(nextChannel.name)
|
||||||
|
);
|
||||||
|
setCurrentChannels(sortedChannelListElements);
|
||||||
setChannelsModalOpen(false);
|
setChannelsModalOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue