aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_settings/user_settings.js
diff options
context:
space:
mode:
authorlambda <pleromagit@rogerbraun.net>2017-12-23 20:20:59 +0000
committerlambda <pleromagit@rogerbraun.net>2017-12-23 20:20:59 +0000
commit28872d8da498e0160a284c7ceda9f9c771e3ca0d (patch)
tree16be46a71cfed4d9ade235dcc9831361d2f3c113 /src/components/user_settings/user_settings.js
parent6fd309452a1d8243257bc8544429ea53a26ce8a4 (diff)
parenta058941aedcfe6a3e14e245b7270477a7a6e69be (diff)
Merge branch 'feature/follow-import' into 'develop'
Add feature: follow import. See merge request pleroma/pleroma-fe!188
Diffstat (limited to 'src/components/user_settings/user_settings.js')
-rw-r--r--src/components/user_settings/user_settings.js31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index fd20a6ad..25ee1f35 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -5,7 +5,10 @@ const UserSettings = {
return {
newname: this.$store.state.users.currentUser.name,
newbio: this.$store.state.users.currentUser.description,
- uploading: [ false, false, false ],
+ followList: null,
+ followImportError: false,
+ followsImported: false,
+ uploading: [ false, false, false, false ],
previews: [ null, null, null ]
}
},
@@ -15,6 +18,9 @@ const UserSettings = {
computed: {
user () {
return this.$store.state.users.currentUser
+ },
+ pleromaBackend () {
+ return this.$store.state.config.pleromaBackend
}
},
methods: {
@@ -117,6 +123,29 @@ const UserSettings = {
}
this.uploading[2] = false
})
+ },
+ importFollows () {
+ this.uploading[3] = true
+ const followList = this.followList
+ this.$store.state.api.backendInteractor.followImport({params: followList})
+ .then((status) => {
+ if (status) {
+ this.followsImported = true
+ } else {
+ this.followImportError = true
+ }
+ this.uploading[3] = false
+ })
+ },
+ followListChange () {
+ // eslint-disable-next-line no-undef
+ let formData = new FormData()
+ formData.append('list', this.$refs.followlist.files[0])
+ this.followList = formData
+ },
+ dismissImported () {
+ this.followsImported = false
+ this.followImportError = false
}
}
}