Improves the manipulation of the data to be outputed to file

This commit is contained in:
Diego Benetti 2019-04-10 11:34:23 -03:00
parent 7e35f03581
commit 6648b622be

View File

@ -99,12 +99,8 @@ class UserOptions extends PureComponent {
const mimeType = 'text/plain';
const userNamesObj = userListService.getUsers();
let userNameListString = '';
Object.keys(userNamesObj).forEach((key) => {
userNameListString += userNamesObj[key].name;
userNameListString += '\n';
});
const userNameListString = Object.keys(userNamesObj)
.map(key => userNamesObj[key].name, []).join('\r\n');
link.setAttribute('download', `save-users-list-${Date.now()}.txt`);
link.setAttribute(
'href',