Skip to content

A local-first personal finance app

budgetfilesSlice: Fix paste-o in fallback sorting by ID (#5918)

Daniel Boles02b0e24d6eaf
diff --git a/packages/desktop-client/src/budgetfiles/budgetfilesSlice.ts b/packages/desktop-client/src/budgetfiles/budgetfilesSlice.ts
index 4daf57ade8..040a65197d 100644
--- a/packages/desktop-client/src/budgetfiles/budgetfilesSlice.ts
+++ b/packages/desktop-client/src/budgetfiles/budgetfilesSlice.ts
@@ -498,7 +498,7 @@ function sortFiles(arr: File[]) {
let i = name1 < name2 ? -1 : name1 > name2 ? 1 : 0;
if (i === 0) {
const xId = x.state === 'remote' ? x.cloudFileId : x.id;
- const yId = x.state === 'remote' ? x.cloudFileId : x.id;
+ const yId = y.state === 'remote' ? y.cloudFileId : y.id;
i = xId < yId ? -1 : xId > yId ? 1 : 0;
}
return i;
diff --git a/upcoming-release-notes/5918.md b/upcoming-release-notes/5918.md
new file mode 100644
index 0000000000..cd6af33170
--- /dev/null
+++ b/upcoming-release-notes/5918.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [db-src]
+---
+
+budgetfilesSlice: Fix fallback sorting of files by ID