From 4fb6e2abbf861ea1048e109abbdab00cb7bdd42a Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 4 Jun 2019 15:59:25 +0300 Subject: [PATCH] [DE mobile] [PE mobile] Fix user output order --- .../mobile/app/controller/Collaboration.js | 9 +++++++-- .../mobile/app/controller/Collaboration.js | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Collaboration.js b/apps/documenteditor/mobile/app/controller/Collaboration.js index 10d296c8f..2542ae428 100644 --- a/apps/documenteditor/mobile/app/controller/Collaboration.js +++ b/apps/documenteditor/mobile/app/controller/Collaboration.js @@ -584,14 +584,19 @@ define([ initials += fio[fio.length - 1].substring(0, 1).toUpperCase(); } if(!item.asc_getView()) { - usersArray.push({ + var userAttr = { color: item.asc_getColor(), id: item.asc_getId(), idOriginal: item.asc_getIdOriginal(), name: item.asc_getUserName(), view: item.asc_getView(), initial: initials - }) + }; + if(item.asc_getIdOriginal() == _userId) { + usersArray.unshift(userAttr); + } else { + usersArray.push(userAttr); + } } }); var userSort = _.chain(usersArray).groupBy('idOriginal').value(); diff --git a/apps/presentationeditor/mobile/app/controller/Collaboration.js b/apps/presentationeditor/mobile/app/controller/Collaboration.js index b515d1dd2..ac31c2bf5 100644 --- a/apps/presentationeditor/mobile/app/controller/Collaboration.js +++ b/apps/presentationeditor/mobile/app/controller/Collaboration.js @@ -173,14 +173,19 @@ define([ initials += fio[fio.length - 1].substring(0, 1).toUpperCase(); } if(!item.asc_getView()) { - usersArray.push({ + var userAttr = { color: item.asc_getColor(), id: item.asc_getId(), idOriginal: item.asc_getIdOriginal(), name: item.asc_getUserName(), view: item.asc_getView(), initial: initials - }) + }; + if(item.asc_getIdOriginal() == _userId) { + usersArray.unshift(userAttr); + } else { + usersArray.push(userAttr); + } } }); var userSort = _.chain(usersArray).groupBy('idOriginal').value();