From 2c8a5ffd971f00648e7bc5f48993fc187f3179f2 Mon Sep 17 00:00:00 2001
From: Saturnino Abril <saturnino.abril@gmail.com>
Date: Sat, 5 Aug 2017 02:00:23 +0800
Subject: [PLT-2407] Improve ordering of uploaded attachments (#7022)

* improve ordering of uploaded attachments

* use LocalizationStore.getLocale() when comparing file names
---
 webapp/components/file_preview.jsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'webapp/components/file_preview.jsx')

diff --git a/webapp/components/file_preview.jsx b/webapp/components/file_preview.jsx
index 93ee53515..3ec656fd4 100644
--- a/webapp/components/file_preview.jsx
+++ b/webapp/components/file_preview.jsx
@@ -41,7 +41,8 @@ export default class FilePreview extends React.Component {
 
     render() {
         var previews = [];
-        this.props.fileInfos.forEach((info) => {
+        const fileInfos = this.props.fileInfos.sort((a, b) => a.create_at - b.create_at);
+        fileInfos.forEach((info) => {
             const type = Utils.getFileType(info.extension);
 
             let className = 'file-preview';
-- 
cgit v1.2.3-1-g7c22

