diff --git a/main.js b/main.js index 5fcb528b..903d4850 100644 --- a/main.js +++ b/main.js @@ -36790,14 +36790,11 @@ class MatrixView extends obsidian.ItemView { this.sortItemsAlpha = (a, b) => { var _a, _b; const { sortByNameShowAlias, alphaSortAsc } = this.plugin.settings; - return (sortByNameShowAlias ? a.to : (_a = a.alt) !== null && _a !== void 0 ? _a : a.to) < - (sortByNameShowAlias ? b.to : (_b = b.alt) !== null && _b !== void 0 ? _b : b.to) - ? alphaSortAsc - ? -1 - : 1 - : alphaSortAsc - ? 1 - : -1; + const aToSort = (sortByNameShowAlias ? a.to : (_a = a.alt) !== null && _a !== void 0 ? _a : a.to).toLowerCase(); + const bToSort = (sortByNameShowAlias ? b.to : (_b = b.alt) !== null && _b !== void 0 ? _b : b.to).toLowerCase(); + const less = alphaSortAsc ? -1 : 1; + const more = alphaSortAsc ? 1 : -1; + return aToSort < bToSort ? less : more; }; this.plugin = plugin; this.db = new Debugger(plugin); diff --git a/src/Views/MatrixView.ts b/src/Views/MatrixView.ts index a542395e..1618bf4a 100644 --- a/src/Views/MatrixView.ts +++ b/src/Views/MatrixView.ts @@ -23,7 +23,7 @@ import { getDVApi, linkClass } from "../Utils/ObsidianUtils"; export default class MatrixView extends ItemView { plugin: BCPlugin; - private view: Matrix | Lists; + private view: MLContainer; matrixQ: boolean; db: Debugger; @@ -151,14 +151,13 @@ export default class MatrixView extends ItemView { sortItemsAlpha = (a: internalLinkObj, b: internalLinkObj) => { const { sortByNameShowAlias, alphaSortAsc } = this.plugin.settings; - return (sortByNameShowAlias ? a.to : a.alt ?? a.to) < - (sortByNameShowAlias ? b.to : b.alt ?? b.to) - ? alphaSortAsc - ? -1 - : 1 - : alphaSortAsc - ? 1 - : -1; + const aToSort = (sortByNameShowAlias ? a.to : a.alt ?? a.to).toLowerCase(); + const bToSort = (sortByNameShowAlias ? b.to : b.alt ?? b.to).toLowerCase(); + + const less = alphaSortAsc ? -1 : 1; + const more = alphaSortAsc ? 1 : -1; + + return aToSort < bToSort ? less : more; }; getHierSquares(userHiers: UserHier[], currFile: TFile): SquareProps[][] {