Fix recent sorting difference with webapp (#7632)
This commit is contained in:
parent
196372eeb4
commit
01fdd1f7d4
1 changed files with 3 additions and 1 deletions
|
|
@ -180,7 +180,9 @@ const sortChannelsByName = (notifyPropsPerChannel: Record<string, Partial<Channe
|
|||
export const sortChannels = (sorting: CategorySorting, channelsWithMyChannel: ChannelWithMyChannel[], notifyPropsPerChannel: Record<string, Partial<ChannelNotifyProps>>, locale: string) => {
|
||||
if (sorting === 'recent') {
|
||||
return channelsWithMyChannel.sort((cwmA, cwmB) => {
|
||||
return cwmB.myChannel.lastPostAt - cwmA.myChannel.lastPostAt;
|
||||
const a = Math.max(cwmA.myChannel.lastPostAt, cwmA.channel.createAt);
|
||||
const b = Math.max(cwmB.myChannel.lastPostAt, cwmB.channel.createAt);
|
||||
return b - a;
|
||||
}).map((cwm) => cwm.channel);
|
||||
} else if (sorting === 'manual') {
|
||||
return channelsWithMyChannel.sort((cwmA, cwmB) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue