This commit is contained in:
syuilo
2017-08-29 02:46:28 +09:00
parent 79ab756040
commit 15d08564c8
5 changed files with 25 additions and 5 deletions

View File

@ -44,6 +44,9 @@
// color #43A4EC
font-weight bold
&:empty
display none
> i
margin-right 0.5em

View File

@ -256,6 +256,7 @@
</style>
<script>
import passwordDialog from '../scripts/password-dialog';
import dialog from '../scripts/dialog';
import notify from '../scripts/notify';
this.mixin('i');
@ -264,11 +265,19 @@
this.reset = () => {
passwordDialog('%i18n:desktop.tags.mk-password-setting.enter-current-password%', currentPassword => {
passwordDialog('%i18n:desktop.tags.mk-password-setting.enter-new-password%', newPassword => {
this.api('i/change_password', {
current_password: currentPassword,
new_password: newPassword
}).then(() => {
notify('%i18n:desktop.tags.mk-password-setting.changed%');
passwordDialog('%i18n:desktop.tags.mk-password-setting.enter-new-password-again%', newPassword2 => {
if (newPassword !== newPassword2) {
dialog(null, '%i18n:desktop.tags.mk-password-setting.not-match%', [{
text: 'OK'
}]);
return;
}
this.api('i/change_password', {
current_password: currentPassword,
new_password: newPassword
}).then(() => {
notify('%i18n:desktop.tags.mk-password-setting.changed%');
});
});
});
});