Skip to content

Commit 9e79de6

Browse files
committed
Use sort instead of toSorted to support Node.js 18
1 parent 74a800e commit 9e79de6

File tree

1 file changed

+2
-1
lines changed
  • packages/snaps-sandbox/src/features/sidebar/components

1 file changed

+2
-1
lines changed

packages/snaps-sandbox/src/features/sidebar/components/History.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export const History: FunctionComponent = () => {
1818
const [favorite, regular] = useMemo(
1919
() =>
2020
history
21-
.toSorted((a, b) => b.timestamp - a.timestamp)
21+
// TODO: Use `toSorted` when dropping support for Node 18.
22+
.sort((a, b) => b.timestamp - a.timestamp)
2223
.reduce<[favorite: HistoryEntry[], regular: HistoryEntry[]]>(
2324
(array, entry) => {
2425
if (entry.favorite) {

0 commit comments

Comments
 (0)