diff --git a/web/src/helpers/dayjs.ts b/web/src/helpers/dayjs.ts index 8d465b483..fc57b2c0d 100644 --- a/web/src/helpers/dayjs.ts +++ b/web/src/helpers/dayjs.ts @@ -39,7 +39,7 @@ export function betterHumanize( const hrs = Math.floor(dur.asHours() % 24); const mins = Math.round(dur.asMinutes() % 60); const seconds = Math.floor(dur.asSeconds() % 60); - let builder = ''; + const builder = []; const daysStr = styleStrings[mergedOpts.style]['day']; const hoursStr = styleStrings[mergedOpts.style]['hour']; @@ -52,36 +52,30 @@ export function betterHumanize( if (days >= 1) { const d = mergedOpts.style === 'full' ? ' ' + pluralize(daysStr, days) : daysStr; - builder += `${days}${d}`; + builder.push(`${days}${d}`); } if (hrs >= 1) { const d = mergedOpts.style === 'full' ? ' ' + pluralize(hoursStr, hrs) : hoursStr; - if (builder.length > 0 && mergedOpts.style === 'full') { - builder += ' '; - } - builder += `${hrs}${d}`; + builder.push(`${hrs}${d}`); } if (mins >= 1) { const minsN = Math.round(mins); const d = mergedOpts.style === 'full' ? ' ' + pluralize(minStr, minsN) : minStr; - if (builder.length > 0 && mergedOpts.style === 'full') { - builder += ' '; - } if (hrs < 1) { const prefix = seconds > 0 && !mergedOpts.exact ? 'about ' : ''; - builder += `${prefix}${padStart(minsN.toString(), 2, '0')}${d}`; + builder.push(`${prefix}${padStart(minsN.toString(), 2, '0')}${d}`); } else { - builder += `${padStart(minsN.toString(), 2, '0')}${d}`; + builder.push(`${padStart(minsN.toString(), 2, '0')}${d}`); } } if (builder.length === 0) { return mergedOpts.style === 'short' ? '0s' : dur.humanize(); } else { - return builder; + return builder.join(' '); } } diff --git a/web/src/pages/channels/ChannelsPage.tsx b/web/src/pages/channels/ChannelsPage.tsx index 5644a1170..760be08d0 100644 --- a/web/src/pages/channels/ChannelsPage.tsx +++ b/web/src/pages/channels/ChannelsPage.tsx @@ -350,12 +350,6 @@ export default function ChannelsPage() { const columnsNew = useMemo[]>( () => [ - { - header: 'Number', - accessorKey: 'number', - minSize: 120, - size: 120, - }, { header: 'Icon', accessorKey: 'icon', @@ -371,6 +365,12 @@ export default function ChannelsPage() { enableColumnFilter: false, enableSorting: false, }, + { + header: 'Number', + accessorKey: 'number', + minSize: 120, + size: 120, + }, { header: 'Name', accessorKey: 'name', @@ -471,7 +471,6 @@ export default function ChannelsPage() { visibleInShowHideMenu: false, }, }, - positionActionsColumn: 'last', renderRowActions: renderActionCell, onColumnVisibilityChange: (updater) => { setColumnVisibility(updater);