Closed chrismelbourne closed 1 year ago
First off, thank you for a wonderful, useful plugin!!
Here's my little contribution :)
Currently sortby: name is broken.
sortby: name
Fix: Lines 125-126: Replace const refA = this._settings.sortby ? a.stat[this._settings.sortby] : a["name"].toUpperCase(); const refB = this._settings.sortby? b.stat[this._settings.sortby] : b["name"].toUpperCase();
With: const refA = (this._settings.sortby !== "name") ? a.stat[this._settings.sortby] : a["name"].toUpperCase(); const refB = (this._settings.sortby !== "name") ? b.stat[this._settings.sortby] : b["name"].toUpperCase();
Reason is that currently, if sortby: name, refA and refB will always be set to a.stat["name"] and b.stat["name"] respectively. But those properties do not exist (only ctime, mtime and size exist under .stat).
Hi @chrismelbourne, thanks for catching this! I just fixed the mistake. I also ended up reversing the logic a little to make it more readable. :)
First off, thank you for a wonderful, useful plugin!!
Here's my little contribution :)
Currently
sortby: name
is broken.Fix: Lines 125-126: Replace const refA = this._settings.sortby ? a.stat[this._settings.sortby] : a["name"].toUpperCase(); const refB = this._settings.sortby? b.stat[this._settings.sortby] : b["name"].toUpperCase();
With: const refA = (this._settings.sortby !== "name") ? a.stat[this._settings.sortby] : a["name"].toUpperCase(); const refB = (this._settings.sortby !== "name") ? b.stat[this._settings.sortby] : b["name"].toUpperCase();
Reason is that currently, if
sortby: name
, refA and refB will always be set to a.stat["name"] and b.stat["name"] respectively. But those properties do not exist (only ctime, mtime and size exist under .stat).