From d64dc458999afdc0bfd5f662a583bd1a0f6eebb3 Mon Sep 17 00:00:00 2001
From: MeiMei <30769358+mei23@users.noreply.github.com>
Date: Mon, 29 Oct 2018 20:32:42 +0900
Subject: User blocking (Following part) (#3035)
* block wip
* UndoBlock
* UnBlock
* wip
* follow
* UI
* fix
---
.../app/desktop/views/pages/user/user.profile.vue | 25 ++++++++++++++++++++++
1 file changed, 25 insertions(+)
(limited to 'src/client/app')
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 @@
%fa:eye% %i18n:@unmute%
%fa:eye-slash% %i18n:@mute%
+
+ %fa:user% %i18n:@unblock%
+ %fa:user-slash% %i18n:@block%
+
%fa:list% %i18n:@push-to-a-list%
@@ -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 => {
--
cgit v1.3.1-freya