diff --git a/CHANGELOG.md b/CHANGELOG.md
index d08da09e..2719edcf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,14 +1,15 @@
# Changelog
All notable changes to this project will be documented in this file.
-The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- Ability to hide/show repeats from user
-- User profile button clutter organized into a menu
+- User profile button clutter organized into a menu
- Emoji picker
- Started changelog anew
+- Ability to change user's email
### Changed
- changed the way fading effects for user profile/long statuses works, now uses css-mask instead of gradient background hacks which weren't exactly compatible with semi-transparent themes
### Fixed
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index 32eb802e..3fdc5340 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -35,6 +35,7 @@ const MuteList = withSubscription({
const UserSettings = {
data () {
return {
+ newEmail: '',
newName: this.$store.state.users.currentUser.name,
newBio: unescape(this.$store.state.users.currentUser.description),
newLocked: this.$store.state.users.currentUser.locked,
@@ -56,6 +57,9 @@ const UserSettings = {
backgroundPreview: null,
bannerUploadError: null,
backgroundUploadError: null,
+ changeEmailError: false,
+ changeEmailPassword: '',
+ changedEmail: false,
deletingAccount: false,
deleteAccountConfirmPasswordInput: '',
deleteAccountError: false,
@@ -305,6 +309,22 @@ const UserSettings = {
}
})
},
+ changeEmail () {
+ const params = {
+ email: this.newEmail,
+ password: this.changeEmailPassword
+ }
+ this.$store.state.api.backendInteractor.changeEmail(params)
+ .then((res) => {
+ if (res.status === 'success') {
+ this.changedEmail = true
+ this.changeEmailError = false
+ } else {
+ this.changedEmail = false
+ this.changeEmailError = res.error
+ }
+ })
+ },
activateTab (tabName) {
this.activeTab = tabName
},
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index adf11907..8c18cf49 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -85,7 +85,7 @@
{{ $t('settings.new_email') }}
+ +{{ $t('settings.current_password') }}
+ ++ {{ $t('settings.changed_email') }} +
+ +{{ $t('settings.change_email_error') }}
+{{ changeEmailError }}
+ +