diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2018-10-29 20:32:42 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2018-10-29 20:32:42 +0900 |
| commit | d64dc458999afdc0bfd5f662a583bd1a0f6eebb3 (patch) | |
| tree | 7bafd2682c100ef3badb7dd0d992dbf35930678a /src/client | |
| parent | Merge branch 'develop' of https://github.com/syuilo/misskey into develop (diff) | |
| download | misskey-d64dc458999afdc0bfd5f662a583bd1a0f6eebb3.tar.gz misskey-d64dc458999afdc0bfd5f662a583bd1a0f6eebb3.tar.bz2 misskey-d64dc458999afdc0bfd5f662a583bd1a0f6eebb3.zip | |
User blocking (Following part) (#3035)
* block wip
* UndoBlock
* UnBlock
* wip
* follow
* UI
* fix
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/desktop/views/pages/user/user.profile.vue | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/client/app/desktop/views/pages/user/user.profile.vue b/src/client/app/desktop/views/pages/user/user.profile.vue index fe864f0d7b..a075995e6e 100644 --- a/src/client/app/desktop/views/pages/user/user.profile.vue +++ b/src/client/app/desktop/views/pages/user/user.profile.vue @@ -13,6 +13,10 @@ <span v-if="user.isMuted">%fa:eye% %i18n:@unmute%</span> <span v-if="!user.isMuted">%fa:eye-slash% %i18n:@mute%</span> </ui-button> + <ui-button @click="user.isBlocking ? unblock() : block()" v-if="$store.state.i.id != user.id"> + <span v-if="user.isBlocking">%fa:user% %i18n:@unblock%</span> + <span v-if="!user.isBlocking">%fa:user-slash% %i18n:@block%</span> + </ui-button> <ui-button @click="list">%fa:list% %i18n:@push-to-a-list%</ui-button> </div> </div> @@ -66,6 +70,27 @@ export default Vue.extend({ }); }, + block() { + if (!window.confirm('%i18n:@block-confirm%')) return; + (this as any).api('blocking/create', { + userId: this.user.id + }).then(() => { + this.user.isBlocking = true; + }, () => { + alert('error'); + }); + }, + + unblock() { + (this as any).api('blocking/delete', { + userId: this.user.id + }).then(() => { + this.user.isBlocking = false; + }, () => { + alert('error'); + }); + }, + list() { const w = (this as any).os.new(MkUserListsWindow); w.$once('choosen', async list => { |