aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/follows
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/follows')
-rw-r--r--client/src/app/+admin/follows/followers-list/followers-list.component.ts32
-rw-r--r--client/src/app/+admin/follows/following-list/follow-modal.component.ts15
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.ts23
-rw-r--r--client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts8
-rw-r--r--client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts16
5 files changed, 48 insertions, 46 deletions
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
index 4a312f6aa..b867b4ba5 100644
--- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts
+++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
@@ -35,17 +35,17 @@ export class FollowersListComponent extends RestTable implements OnInit {
35 follow.state = 'accepted' 35 follow.state = 'accepted'
36 36
37 this.followService.acceptFollower(follow) 37 this.followService.acceptFollower(follow)
38 .subscribe( 38 .subscribe({
39 () => { 39 next: () => {
40 const handle = follow.follower.name + '@' + follow.follower.host 40 const handle = follow.follower.name + '@' + follow.follower.host
41 this.notifier.success($localize`${handle} accepted in instance followers`) 41 this.notifier.success($localize`${handle} accepted in instance followers`)
42 }, 42 },
43 43
44 err => { 44 error: err => {
45 follow.state = 'pending' 45 follow.state = 'pending'
46 this.notifier.error(err.message) 46 this.notifier.error(err.message)
47 } 47 }
48 ) 48 })
49 } 49 }
50 50
51 async rejectFollower (follow: ActorFollow) { 51 async rejectFollower (follow: ActorFollow) {
@@ -54,19 +54,19 @@ export class FollowersListComponent extends RestTable implements OnInit {
54 if (res === false) return 54 if (res === false) return
55 55
56 this.followService.rejectFollower(follow) 56 this.followService.rejectFollower(follow)
57 .subscribe( 57 .subscribe({
58 () => { 58 next: () => {
59 const handle = follow.follower.name + '@' + follow.follower.host 59 const handle = follow.follower.name + '@' + follow.follower.host
60 this.notifier.success($localize`${handle} rejected from instance followers`) 60 this.notifier.success($localize`${handle} rejected from instance followers`)
61 61
62 this.reloadData() 62 this.reloadData()
63 }, 63 },
64 64
65 err => { 65 error: err => {
66 follow.state = 'pending' 66 follow.state = 'pending'
67 this.notifier.error(err.message) 67 this.notifier.error(err.message)
68 } 68 }
69 ) 69 })
70 } 70 }
71 71
72 async deleteFollower (follow: ActorFollow) { 72 async deleteFollower (follow: ActorFollow) {
@@ -75,27 +75,27 @@ export class FollowersListComponent extends RestTable implements OnInit {
75 if (res === false) return 75 if (res === false) return
76 76
77 this.followService.removeFollower(follow) 77 this.followService.removeFollower(follow)
78 .subscribe( 78 .subscribe({
79 () => { 79 next: () => {
80 const handle = follow.follower.name + '@' + follow.follower.host 80 const handle = follow.follower.name + '@' + follow.follower.host
81 this.notifier.success($localize`${handle} removed from instance followers`) 81 this.notifier.success($localize`${handle} removed from instance followers`)
82 82
83 this.reloadData() 83 this.reloadData()
84 }, 84 },
85 85
86 err => this.notifier.error(err.message) 86 error: err => this.notifier.error(err.message)
87 ) 87 })
88 } 88 }
89 89
90 protected reloadData () { 90 protected reloadData () {
91 this.followService.getFollowers({ pagination: this.pagination, sort: this.sort, search: this.search }) 91 this.followService.getFollowers({ pagination: this.pagination, sort: this.sort, search: this.search })
92 .subscribe( 92 .subscribe({
93 resultList => { 93 next: resultList => {
94 this.followers = resultList.data 94 this.followers = resultList.data
95 this.totalRecords = resultList.total 95 this.totalRecords = resultList.total
96 }, 96 },
97 97
98 err => this.notifier.error(err.message) 98 error: err => this.notifier.error(err.message)
99 ) 99 })
100 } 100 }
101} 101}
diff --git a/client/src/app/+admin/follows/following-list/follow-modal.component.ts b/client/src/app/+admin/follows/following-list/follow-modal.component.ts
index dc6909200..c55fc8d81 100644
--- a/client/src/app/+admin/follows/following-list/follow-modal.component.ts
+++ b/client/src/app/+admin/follows/following-list/follow-modal.component.ts
@@ -57,13 +57,14 @@ export class FollowModalComponent extends FormReactive implements OnInit {
57 private async addFollowing () { 57 private async addFollowing () {
58 const hostsOrHandles = splitAndGetNotEmpty(this.form.value['hostsOrHandles']) 58 const hostsOrHandles = splitAndGetNotEmpty(this.form.value['hostsOrHandles'])
59 59
60 this.followService.follow(hostsOrHandles).subscribe( 60 this.followService.follow(hostsOrHandles)
61 () => { 61 .subscribe({
62 this.notifier.success($localize`Follow request(s) sent!`) 62 next: () => {
63 this.newFollow.emit() 63 this.notifier.success($localize`Follow request(s) sent!`)
64 }, 64 this.newFollow.emit()
65 },
65 66
66 err => this.notifier.error(err.message) 67 error: err => this.notifier.error(err.message)
67 ) 68 })
68 } 69 }
69} 70}
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts
index ba62dfa23..cf0225098 100644
--- a/client/src/app/+admin/follows/following-list/following-list.component.ts
+++ b/client/src/app/+admin/follows/following-list/following-list.component.ts
@@ -49,25 +49,26 @@ export class FollowingListComponent extends RestTable implements OnInit {
49 ) 49 )
50 if (res === false) return 50 if (res === false) return
51 51
52 this.followService.unfollow(follow).subscribe( 52 this.followService.unfollow(follow)
53 () => { 53 .subscribe({
54 this.notifier.success($localize`You are not following ${follow.following.host} anymore.`) 54 next: () => {
55 this.reloadData() 55 this.notifier.success($localize`You are not following ${follow.following.host} anymore.`)
56 }, 56 this.reloadData()
57 },
57 58
58 err => this.notifier.error(err.message) 59 error: err => this.notifier.error(err.message)
59 ) 60 })
60 } 61 }
61 62
62 protected reloadData () { 63 protected reloadData () {
63 this.followService.getFollowing({ pagination: this.pagination, sort: this.sort, search: this.search }) 64 this.followService.getFollowing({ pagination: this.pagination, sort: this.sort, search: this.search })
64 .subscribe( 65 .subscribe({
65 resultList => { 66 next: resultList => {
66 this.following = resultList.data 67 this.following = resultList.data
67 this.totalRecords = resultList.total 68 this.totalRecords = resultList.total
68 }, 69 },
69 70
70 err => this.notifier.error(err.message) 71 error: err => this.notifier.error(err.message)
71 ) 72 })
72 } 73 }
73} 74}
diff --git a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts
index 729b7f599..47c402510 100644
--- a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts
+++ b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts
@@ -18,14 +18,14 @@ export class RedundancyCheckboxComponent {
18 18
19 updateRedundancyState () { 19 updateRedundancyState () {
20 this.redundancyService.updateRedundancy(this.host, this.redundancyAllowed) 20 this.redundancyService.updateRedundancy(this.host, this.redundancyAllowed)
21 .subscribe( 21 .subscribe({
22 () => { 22 next: () => {
23 const stateLabel = this.redundancyAllowed ? $localize`enabled` : $localize`disabled` 23 const stateLabel = this.redundancyAllowed ? $localize`enabled` : $localize`disabled`
24 24
25 this.notifier.success($localize`Redundancy for ${this.host} is ${stateLabel}`) 25 this.notifier.success($localize`Redundancy for ${this.host} is ${stateLabel}`)
26 }, 26 },
27 27
28 err => this.notifier.error(err.message) 28 error: err => this.notifier.error(err.message)
29 ) 29 })
30 } 30 }
31} 31}
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
index 3cd65dd6e..4c691269a 100644
--- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
+++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
@@ -142,14 +142,14 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit
142 if (res === false) return 142 if (res === false) return
143 143
144 this.redundancyService.removeVideoRedundancies(redundancy) 144 this.redundancyService.removeVideoRedundancies(redundancy)
145 .subscribe( 145 .subscribe({
146 () => { 146 next: () => {
147 this.notifier.success($localize`Video redundancies removed!`) 147 this.notifier.success($localize`Video redundancies removed!`)
148 this.reloadData() 148 this.reloadData()
149 }, 149 },
150 150
151 err => this.notifier.error(err.message) 151 error: err => this.notifier.error(err.message)
152 ) 152 })
153 153
154 } 154 }
155 155
@@ -161,14 +161,14 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit
161 } 161 }
162 162
163 this.redundancyService.listVideoRedundancies(options) 163 this.redundancyService.listVideoRedundancies(options)
164 .subscribe( 164 .subscribe({
165 resultList => { 165 next: resultList => {
166 this.videoRedundancies = resultList.data 166 this.videoRedundancies = resultList.data
167 this.totalRecords = resultList.total 167 this.totalRecords = resultList.total
168 }, 168 },
169 169
170 err => this.notifier.error(err.message) 170 error: err => this.notifier.error(err.message)
171 ) 171 })
172 } 172 }
173 173
174 private loadSelectLocalStorage () { 174 private loadSelectLocalStorage () {