aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortaehoon <th.dev91@gmail.com>2019-03-30 08:17:37 -0400
committertaehoon <th.dev91@gmail.com>2019-04-27 08:31:06 -0400
commitab19669bf1470f1e2dfe35cb17e3f748edf4c2d2 (patch)
tree9e211814ee70bfa3d511ccea48a2ddaac13afd4c /src
parent95bc2d727b8a94e9050a71c27838eb2a0d765011 (diff)
refactoring
Diffstat (limited to 'src')
-rw-r--r--src/components/user_settings/user_settings.js38
1 files changed, 14 insertions, 24 deletions
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index de8b4ebf..748f23f7 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -251,35 +251,25 @@ const UserSettings = {
}
})
},
+ generateExportableUsersContent (users) {
+ // Get addresses
+ return users.map((user) => {
+ // check is it's a local user
+ if (user && user.is_local) {
+ // append the instance address
+ // eslint-disable-next-line no-undef
+ return user.screen_name + '@' + location.hostname
+ }
+ return user.screen_name
+ }).join('\n')
+ },
getFollowsContent () {
return this.$store.state.api.backendInteractor.exportFriends({ id: this.$store.state.users.currentUser.id })
- .then((users) => {
- // Get all the friends addresses
- return users.map((user) => {
- // check is it's a local user
- if (user && user.is_local) {
- // append the instance address
- // eslint-disable-next-line no-undef
- return user.screen_name + '@' + location.hostname
- }
- return user.screen_name
- }).join('\n')
- })
+ .then(this.generateExportableUsersContent)
},
getBlocksContent () {
return this.$store.state.api.backendInteractor.fetchBlocks()
- .then((users) => {
- // Get all the friends addresses
- return users.map((user) => {
- // check is it's a local user
- if (user && user.is_local) {
- // append the instance address
- // eslint-disable-next-line no-undef
- return user.screen_name + '@' + location.hostname
- }
- return user.screen_name
- }).join('\n')
- })
+ .then(this.generateExportableUsersContent)
},
confirmDelete () {
this.deletingAccount = true