|
|
@ -8,6 +8,7 @@ const UserSettings = {
|
|
|
|
followList: null,
|
|
|
|
followList: null,
|
|
|
|
followImportError: false,
|
|
|
|
followImportError: false,
|
|
|
|
followsImported: false,
|
|
|
|
followsImported: false,
|
|
|
|
|
|
|
|
enableFollowsExport: true,
|
|
|
|
uploading: [ false, false, false, false ],
|
|
|
|
uploading: [ false, false, false, false ],
|
|
|
|
previews: [ null, null, null ]
|
|
|
|
previews: [ null, null, null ]
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -137,6 +138,34 @@ const UserSettings = {
|
|
|
|
this.uploading[3] = false
|
|
|
|
this.uploading[3] = false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
/* This function takes an Array of Users
|
|
|
|
|
|
|
|
* and outputs a file with all the addresses for the user to download
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
exportPeople(Users) {
|
|
|
|
|
|
|
|
// Get all the friends addresses
|
|
|
|
|
|
|
|
var UserAddresses = Users.map(function(user) {
|
|
|
|
|
|
|
|
// check is it's a local user
|
|
|
|
|
|
|
|
if(user && user.is_local) {
|
|
|
|
|
|
|
|
// append the instance address
|
|
|
|
|
|
|
|
user.screen_name += '@' + location.hostname;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
exportFollows() {
|
|
|
|
|
|
|
|
this.enableFollowsExport = false;
|
|
|
|
|
|
|
|
this.$store.state.api.backendInteractor
|
|
|
|
|
|
|
|
.fetchFriends({id: this.$store.state.users.currentUser.id})
|
|
|
|
|
|
|
|
.then(this.exportPeople);
|
|
|
|
|
|
|
|
},
|
|
|
|
followListChange () {
|
|
|
|
followListChange () {
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
let formData = new FormData()
|
|
|
|
let formData = new FormData()
|
|
|
|