From 95bc2d727b8a94e9050a71c27838eb2a0d765011 Mon Sep 17 00:00:00 2001 From: taehoon Date: Sat, 30 Mar 2019 08:14:52 -0400 Subject: [PATCH] =?UTF-8?q?add=20=E2=80=9Cexport=20blocks=E2=80=9D=20featu?= =?UTF-8?q?re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/user_settings/user_settings.js | 19 +++++++++++++++++-- .../user_settings/user_settings.vue | 4 ++++ src/i18n/en.json | 2 ++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index d40301f2..de8b4ebf 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -253,9 +253,24 @@ const UserSettings = { }, getFollowsContent () { return this.$store.state.api.backendInteractor.exportFriends({ id: this.$store.state.users.currentUser.id }) - .then((friendList) => { + .then((users) => { // Get all the friends addresses - return friendList.map((user) => { + 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') + }) + }, + 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 diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue index db8c1ea9..8a94f0b8 100644 --- a/src/components/user_settings/user_settings.vue +++ b/src/components/user_settings/user_settings.vue @@ -182,6 +182,10 @@

{{$t('settings.import_blocks_from_a_csv_file')}}

+
+

{{$t('settings.block_export')}}

+ +
diff --git a/src/i18n/en.json b/src/i18n/en.json index 10283024..173e0de2 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -135,6 +135,8 @@ "avatarRadius": "Avatars", "background": "Background", "bio": "Bio", + "block_export": "Block export", + "block_export_button": "Export your blocks to a csv file", "block_import": "Block import", "block_import_error": "Error importing blocks", "blocks_imported": "Blocks imported! Processing them will take a while.",