diff --git a/apps/nextjs/src/components/layout/header/query-refresh-indicator.tsx b/apps/nextjs/src/components/layout/header/query-refresh-indicator.tsx index 3c9188a9b..0ed917fd6 100644 --- a/apps/nextjs/src/components/layout/header/query-refresh-indicator.tsx +++ b/apps/nextjs/src/components/layout/header/query-refresh-indicator.tsx @@ -169,9 +169,7 @@ export const QueryRefreshIndicator = () => { }; const QueryMenuItem = ({ row }: { row: QueryStatusRow }) => { - const rowColor = statusColorMap[ - row.fetchStatus === "fetching" ? "fetching" : `idle_${row.status}` - ] ?? "gray"; + const rowColor = statusColorMap[row.fetchStatus === "fetching" ? "fetching" : `idle_${row.status}`] ?? "gray"; const updatedLabel = row.dataUpdatedAt > 0 ? dayjs(row.dataUpdatedAt).fromNow() : "never"; diff --git a/packages/widgets/src/bookmarks/component.tsx b/packages/widgets/src/bookmarks/component.tsx index a6b8853ad..c74e57744 100644 --- a/packages/widgets/src/bookmarks/component.tsx +++ b/packages/widgets/src/bookmarks/component.tsx @@ -16,7 +16,7 @@ export default function BookmarksWidget({ options, itemId }: WidgetComponentProp const board = useRequiredBoard(); const { data = [] } = clientApi.app.byIds.useQuery(options.items, { select(data) { - return data.sort((appA, appB) => options.items.indexOf(appA.id) - options.items.indexOf(appB.id)); + return data.toSorted((appA, appB) => options.items.indexOf(appA.id) - options.items.indexOf(appB.id)); }, }); diff --git a/packages/widgets/src/health-monitoring/system-health.tsx b/packages/widgets/src/health-monitoring/system-health.tsx index 4a66b61ac..c26f63254 100644 --- a/packages/widgets/src/health-monitoring/system-health.tsx +++ b/packages/widgets/src/health-monitoring/system-health.tsx @@ -332,5 +332,5 @@ export const matchFileSystemAndSmart = (fileSystems: FileSystem[], smartData: Sm overallStatus: smartDisk?.overallStatus ?? "", }; }) - .sort((fileSystemA, fileSystemB) => fileSystemA.deviceName.localeCompare(fileSystemB.deviceName)); + .toSorted((fileSystemA, fileSystemB) => fileSystemA.deviceName.localeCompare(fileSystemB.deviceName)); }; diff --git a/packages/widgets/src/media-requests/list/component.tsx b/packages/widgets/src/media-requests/list/component.tsx index 0a40ac72e..528f29fdd 100644 --- a/packages/widgets/src/media-requests/list/component.tsx +++ b/packages/widgets/src/media-requests/list/component.tsx @@ -43,7 +43,7 @@ export default function MediaServerWidget({ const newData = filteredData.concat( data.requests.map((request) => ({ ...request, integrationId: data.integrationId })), ); - return newData.sort((dataA, dataB) => { + return newData.toSorted((dataA, dataB) => { if (dataA.status === dataB.status) { return dataB.createdAt.getTime() - dataA.createdAt.getTime(); } diff --git a/packages/widgets/src/releases/component.tsx b/packages/widgets/src/releases/component.tsx index 56e482a45..cc41e8b68 100644 --- a/packages/widgets/src/releases/component.tsx +++ b/packages/widgets/src/releases/component.tsx @@ -126,7 +126,7 @@ export default function ReleasesWidget({ options }: WidgetComponentProps<"releas (repository) => "error" in repository || !options.showOnlyHighlighted || repository.isNewRelease || repository.isStaleRelease, ) - .sort((repoA, repoB) => { + .toSorted((repoA, repoB) => { if ("error" in repoA) return -1; if ("error" in repoB) return 1; return repoA.latestReleaseAt > repoB.latestReleaseAt ? -1 : 1; diff --git a/packages/widgets/src/rssFeed/component.tsx b/packages/widgets/src/rssFeed/component.tsx index 008e06c7d..49cf807ea 100644 --- a/packages/widgets/src/rssFeed/component.tsx +++ b/packages/widgets/src/rssFeed/component.tsx @@ -26,7 +26,7 @@ const useLiveFeedEntries = (input: RouterInputs["widget"]["rssFeed"]["getFeeds"] return oldData ?.filter((entry) => entry.feedUrl !== updatedData.url) .concat(updatedData.entries) - .sort((entryA, entryB) => { + .toSorted((entryA, entryB) => { return entryA.published && entryB.published ? new Date(entryB.published).getTime() - new Date(entryA.published).getTime() : 0; diff --git a/packages/widgets/src/umami/umami-content.tsx b/packages/widgets/src/umami/umami-content.tsx index 9121609ed..e6dd90a8f 100644 --- a/packages/widgets/src/umami/umami-content.tsx +++ b/packages/widgets/src/umami/umami-content.tsx @@ -57,7 +57,7 @@ export function UmamiContent({ }); const { data: multiEventSeries } = clientApi.widget.umami.getMultiEventTimeSeries.useQuery( - { integrationId: integrationIds[0] ?? "", websiteId, timeFrame, eventNames: [...eventNames].sort() }, + { integrationId: integrationIds[0] ?? "", websiteId, timeFrame, eventNames: [...eventNames].toSorted() }, { enabled: viewMode === "events" && eventNames.length > 0 }, ); diff --git a/packages/widgets/src/umami/umami-events-content.tsx b/packages/widgets/src/umami/umami-events-content.tsx index c6d1acedd..6dfac617c 100644 --- a/packages/widgets/src/umami/umami-events-content.tsx +++ b/packages/widgets/src/umami/umami-events-content.tsx @@ -32,7 +32,7 @@ export function UmamiEventsContent({ integrationId: integrationIds[0] ?? "", websiteId, timeFrame, - eventNames: [...eventNames].sort(), + eventNames: [...eventNames].toSorted(), }); if (eventNames.length === 0) { @@ -48,7 +48,7 @@ export function UmamiEventsContent({ // Collect all unique timestamps across all series const allTimestamps = Array.from( new Set(series.flatMap(({ dataPoints }) => dataPoints.map(({ x: xPoint }) => xPoint))), - ).sort(); + ).toSorted(); // Build per-event lookup by timestamp string const byEvent = new Map(