From defaf5d1ce572e448baf6bfd3da8685a5bf7f715 Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Mon, 31 May 2021 17:18:26 -0300 Subject: [PATCH] sort entries in refresh, not NavDir.get_children() --- navigator/navigator.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/navigator/navigator.js b/navigator/navigator.js index f2631e1..211bc3e 100644 --- a/navigator/navigator.js +++ b/navigator/navigator.js @@ -568,14 +568,6 @@ class NavDir extends NavEntry { break; } }); - children.sort((first, second) => { - if (first.nav_type === second.nav_type) { - return first.filename().localeCompare(second.filename()); - } - if (first.nav_type === "dir") - return -1; - return 1; - }); return children; } @@ -723,6 +715,14 @@ class NavWindow { var entry = this.entries.pop(); entry.destroy(); } + files.sort((first, second) => { + if (first.nav_type === second.nav_type) { + return first.filename().localeCompare(second.filename()); + } + if (first.nav_type === "dir") + return -1; + return 1; + }); files.forEach((file) => { if (file.nav_type === "dir") num_dirs++;