aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-17 11:27:47 +0200
committerChocobozzz <me@florianbigard.com>2021-08-17 14:01:45 +0200
commit1378c0d343028f3d40d7d795422684ab9e6a1599 (patch)
tree08062b84a38a7e2dfe0aa674e7ca8e1b7321044e /client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
parentc186a67f90203af6bfa434f026efdc99193bcd65 (diff)
downloadPeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.gz
PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.zst
PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.zip
Fix client lint
Diffstat (limited to 'client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts')
-rw-r--r--client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts112
1 files changed, 57 insertions, 55 deletions
diff --git a/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
index 8c5a48d42..9f1e1bf9b 100644
--- a/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
+++ b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
@@ -67,14 +67,14 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
67 if (res === false) return 67 if (res === false) return
68 68
69 this.userService.unbanUsers(user) 69 this.userService.unbanUsers(user)
70 .subscribe( 70 .subscribe({
71 () => { 71 next: () => {
72 this.notifier.success($localize`User ${user.username} unbanned.`) 72 this.notifier.success($localize`User ${user.username} unbanned.`)
73 this.userChanged.emit() 73 this.userChanged.emit()
74 }, 74 },
75 75
76 err => this.notifier.error(err.message) 76 error: err => this.notifier.error(err.message)
77 ) 77 })
78 } 78 }
79 79
80 async removeUser (user: User) { 80 async removeUser (user: User) {
@@ -87,137 +87,139 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
87 const res = await this.confirmService.confirm(message, $localize`Delete`) 87 const res = await this.confirmService.confirm(message, $localize`Delete`)
88 if (res === false) return 88 if (res === false) return
89 89
90 this.userService.removeUser(user).subscribe( 90 this.userService.removeUser(user)
91 () => { 91 .subscribe({
92 this.notifier.success($localize`User ${user.username} deleted.`) 92 next: () => {
93 this.userDeleted.emit() 93 this.notifier.success($localize`User ${user.username} deleted.`)
94 }, 94 this.userDeleted.emit()
95 },
95 96
96 err => this.notifier.error(err.message) 97 error: err => this.notifier.error(err.message)
97 ) 98 })
98 } 99 }
99 100
100 setEmailAsVerified (user: User) { 101 setEmailAsVerified (user: User) {
101 this.userService.updateUser(user.id, { emailVerified: true }).subscribe( 102 this.userService.updateUser(user.id, { emailVerified: true })
102 () => { 103 .subscribe({
103 this.notifier.success($localize`User ${user.username} email set as verified`) 104 next: () => {
104 this.userChanged.emit() 105 this.notifier.success($localize`User ${user.username} email set as verified`)
105 }, 106 this.userChanged.emit()
106 107 },
107 err => this.notifier.error(err.message) 108
108 ) 109 error: err => this.notifier.error(err.message)
110 })
109 } 111 }
110 112
111 blockAccountByUser (account: Account) { 113 blockAccountByUser (account: Account) {
112 this.blocklistService.blockAccountByUser(account) 114 this.blocklistService.blockAccountByUser(account)
113 .subscribe( 115 .subscribe({
114 () => { 116 next: () => {
115 this.notifier.success($localize`Account ${account.nameWithHost} muted.`) 117 this.notifier.success($localize`Account ${account.nameWithHost} muted.`)
116 118
117 this.account.mutedByUser = true 119 this.account.mutedByUser = true
118 this.userChanged.emit() 120 this.userChanged.emit()
119 }, 121 },
120 122
121 err => this.notifier.error(err.message) 123 error: err => this.notifier.error(err.message)
122 ) 124 })
123 } 125 }
124 126
125 unblockAccountByUser (account: Account) { 127 unblockAccountByUser (account: Account) {
126 this.blocklistService.unblockAccountByUser(account) 128 this.blocklistService.unblockAccountByUser(account)
127 .subscribe( 129 .subscribe({
128 () => { 130 next: () => {
129 this.notifier.success($localize`Account ${account.nameWithHost} unmuted.`) 131 this.notifier.success($localize`Account ${account.nameWithHost} unmuted.`)
130 132
131 this.account.mutedByUser = false 133 this.account.mutedByUser = false
132 this.userChanged.emit() 134 this.userChanged.emit()
133 }, 135 },
134 136
135 err => this.notifier.error(err.message) 137 error: err => this.notifier.error(err.message)
136 ) 138 })
137 } 139 }
138 140
139 blockServerByUser (host: string) { 141 blockServerByUser (host: string) {
140 this.blocklistService.blockServerByUser(host) 142 this.blocklistService.blockServerByUser(host)
141 .subscribe( 143 .subscribe({
142 () => { 144 next: () => {
143 this.notifier.success($localize`Instance ${host} muted.`) 145 this.notifier.success($localize`Instance ${host} muted.`)
144 146
145 this.account.mutedServerByUser = true 147 this.account.mutedServerByUser = true
146 this.userChanged.emit() 148 this.userChanged.emit()
147 }, 149 },
148 150
149 err => this.notifier.error(err.message) 151 error: err => this.notifier.error(err.message)
150 ) 152 })
151 } 153 }
152 154
153 unblockServerByUser (host: string) { 155 unblockServerByUser (host: string) {
154 this.blocklistService.unblockServerByUser(host) 156 this.blocklistService.unblockServerByUser(host)
155 .subscribe( 157 .subscribe({
156 () => { 158 next: () => {
157 this.notifier.success($localize`Instance ${host} unmuted.`) 159 this.notifier.success($localize`Instance ${host} unmuted.`)
158 160
159 this.account.mutedServerByUser = false 161 this.account.mutedServerByUser = false
160 this.userChanged.emit() 162 this.userChanged.emit()
161 }, 163 },
162 164
163 err => this.notifier.error(err.message) 165 error: err => this.notifier.error(err.message)
164 ) 166 })
165 } 167 }
166 168
167 blockAccountByInstance (account: Account) { 169 blockAccountByInstance (account: Account) {
168 this.blocklistService.blockAccountByInstance(account) 170 this.blocklistService.blockAccountByInstance(account)
169 .subscribe( 171 .subscribe({
170 () => { 172 next: () => {
171 this.notifier.success($localize`Account ${account.nameWithHost} muted by the instance.`) 173 this.notifier.success($localize`Account ${account.nameWithHost} muted by the instance.`)
172 174
173 this.account.mutedByInstance = true 175 this.account.mutedByInstance = true
174 this.userChanged.emit() 176 this.userChanged.emit()
175 }, 177 },
176 178
177 err => this.notifier.error(err.message) 179 error: err => this.notifier.error(err.message)
178 ) 180 })
179 } 181 }
180 182
181 unblockAccountByInstance (account: Account) { 183 unblockAccountByInstance (account: Account) {
182 this.blocklistService.unblockAccountByInstance(account) 184 this.blocklistService.unblockAccountByInstance(account)
183 .subscribe( 185 .subscribe({
184 () => { 186 next: () => {
185 this.notifier.success($localize`Account ${account.nameWithHost} unmuted by the instance.`) 187 this.notifier.success($localize`Account ${account.nameWithHost} unmuted by the instance.`)
186 188
187 this.account.mutedByInstance = false 189 this.account.mutedByInstance = false
188 this.userChanged.emit() 190 this.userChanged.emit()
189 }, 191 },
190 192
191 err => this.notifier.error(err.message) 193 error: err => this.notifier.error(err.message)
192 ) 194 })
193 } 195 }
194 196
195 blockServerByInstance (host: string) { 197 blockServerByInstance (host: string) {
196 this.blocklistService.blockServerByInstance(host) 198 this.blocklistService.blockServerByInstance(host)
197 .subscribe( 199 .subscribe({
198 () => { 200 next: () => {
199 this.notifier.success($localize`Instance ${host} muted by the instance.`) 201 this.notifier.success($localize`Instance ${host} muted by the instance.`)
200 202
201 this.account.mutedServerByInstance = true 203 this.account.mutedServerByInstance = true
202 this.userChanged.emit() 204 this.userChanged.emit()
203 }, 205 },
204 206
205 err => this.notifier.error(err.message) 207 error: err => this.notifier.error(err.message)
206 ) 208 })
207 } 209 }
208 210
209 unblockServerByInstance (host: string) { 211 unblockServerByInstance (host: string) {
210 this.blocklistService.unblockServerByInstance(host) 212 this.blocklistService.unblockServerByInstance(host)
211 .subscribe( 213 .subscribe({
212 () => { 214 next: () => {
213 this.notifier.success($localize`Instance ${host} unmuted by the instance.`) 215 this.notifier.success($localize`Instance ${host} unmuted by the instance.`)
214 216
215 this.account.mutedServerByInstance = false 217 this.account.mutedServerByInstance = false
216 this.userChanged.emit() 218 this.userChanged.emit()
217 }, 219 },
218 220
219 err => this.notifier.error(err.message) 221 error: err => this.notifier.error(err.message)
220 ) 222 })
221 } 223 }
222 224
223 async bulkRemoveCommentsOf (body: BulkRemoveCommentsOfBody) { 225 async bulkRemoveCommentsOf (body: BulkRemoveCommentsOfBody) {
@@ -226,13 +228,13 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
226 if (res === false) return 228 if (res === false) return
227 229
228 this.bulkService.removeCommentsOf(body) 230 this.bulkService.removeCommentsOf(body)
229 .subscribe( 231 .subscribe({
230 () => { 232 next: () => {
231 this.notifier.success($localize`Will remove comments of this account (may take several minutes).`) 233 this.notifier.success($localize`Will remove comments of this account (may take several minutes).`)
232 }, 234 },
233 235
234 err => this.notifier.error(err.message) 236 error: err => this.notifier.error(err.message)
235 ) 237 })
236 } 238 }
237 239
238 getRouterUserEditLink (user: User) { 240 getRouterUserEditLink (user: User) {