From 32277688af2fb252c459595f976f71dfd81c1b57 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 1 May 2023 12:01:35 +0200 Subject: [PATCH] Resolve #1109 --- plugins/nextcloud/js/webdav.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/nextcloud/js/webdav.js b/plugins/nextcloud/js/webdav.js index d5c77da61..887e686fd 100644 --- a/plugins/nextcloud/js/webdav.js +++ b/plugins/nextcloud/js/webdav.js @@ -118,6 +118,13 @@ const buildTree = (view, parent, items, path) => { if (items.length) { + try { + // https://github.com/the-djmaze/snappymail/issues/1109 + let collator = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'}); + items.sort((a, b) => collator.compare(a.name, b.name)); + } catch (e) { + console.error(e); + } items.forEach(item => { if (!item.isFile) { let li = document.createElement('li'),