fix linting
This commit is contained in:
parent
fae7a40aeb
commit
fed8781583
2 changed files with 24 additions and 21 deletions
|
@ -141,30 +141,33 @@ const UserSettings = {
|
|||
/* This function takes an Array of Users
|
||||
* and outputs a file with all the addresses for the user to download
|
||||
*/
|
||||
exportPeople(Users) {
|
||||
exportPeople (users, filename) {
|
||||
// Get all the friends addresses
|
||||
var UserAddresses = Users.map(function(user) {
|
||||
var UserAddresses = users.map(function (user) {
|
||||
// check is it's a local user
|
||||
if(user && user.is_local) {
|
||||
if (user && user.is_local) {
|
||||
// append the instance address
|
||||
user.screen_name += '@' + location.hostname;
|
||||
// eslint-disable-next-line no-undef
|
||||
user.screen_name += '@' + location.hostname
|
||||
}
|
||||
return user.screen_name;
|
||||
}).join('\n');
|
||||
return user.screen_name
|
||||
}).join('\n')
|
||||
// Make the user download the file
|
||||
var fileToDownload = document.createElement('a');
|
||||
fileToDownload.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(UserAddresses));
|
||||
fileToDownload.setAttribute('download', 'friends.csv');
|
||||
fileToDownload.style.display = 'none';
|
||||
document.body.appendChild(fileToDownload);
|
||||
fileToDownload.click();
|
||||
document.body.removeChild(fileToDownload);
|
||||
var fileToDownload = document.createElement('a')
|
||||
fileToDownload.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(UserAddresses))
|
||||
fileToDownload.setAttribute('download', filename)
|
||||
fileToDownload.style.display = 'none'
|
||||
document.body.appendChild(fileToDownload)
|
||||
fileToDownload.click()
|
||||
document.body.removeChild(fileToDownload)
|
||||
},
|
||||
exportFollows() {
|
||||
this.enableFollowsExport = false;
|
||||
exportFollows () {
|
||||
this.enableFollowsExport = false
|
||||
this.$store.state.api.backendInteractor
|
||||
.fetchFriends({id: this.$store.state.users.currentUser.id})
|
||||
.then(this.exportPeople);
|
||||
.then(function (friendList) {
|
||||
this.exportPeople(friendList, 'friends.csv')
|
||||
}.bind(this))
|
||||
},
|
||||
followListChange () {
|
||||
// eslint-disable-next-line no-undef
|
||||
|
|
|
@ -290,7 +290,7 @@ const en = {
|
|||
follows_imported: 'Follows imported! Processing them will take a while.',
|
||||
follow_import_error: 'Error importing followers',
|
||||
follow_export: 'Follow export',
|
||||
follow_export_processing: 'Processing, you\'ll soon be aked to download your file',
|
||||
follow_export_processing: 'Processing, you\'ll soon be asked to download your file',
|
||||
follow_export_button: 'Export your follows to a csv file'
|
||||
},
|
||||
notifications: {
|
||||
|
|
Loading…
Reference in a new issue