aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-25 16:14:11 +0200
committerChocobozzz <me@florianbigard.com>2021-08-26 10:01:42 +0200
commit98ab5dc81048d47d08a231f17698128f959e59b2 (patch)
tree7f74f835dc35d9f72918c56857f7f28b70d7053f /client/src/app
parent851675c5591dcab1070183f0ed1b1a788de07d2c (diff)
downloadPeerTube-98ab5dc81048d47d08a231f17698128f959e59b2.tar.gz
PeerTube-98ab5dc81048d47d08a231f17698128f959e59b2.tar.zst
PeerTube-98ab5dc81048d47d08a231f17698128f959e59b2.zip
Remove useless async
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts2
-rw-r--r--client/src/app/+admin/follows/following-list/follow-modal.component.ts2
-rw-r--r--client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts2
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.ts2
-rw-r--r--client/src/app/+home/home.component.ts2
-rw-r--r--client/src/app/+search/search.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-edit.component.ts2
-rw-r--r--client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts3
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.ts4
-rw-r--r--client/src/app/app.component.ts4
-rw-r--r--client/src/app/core/notification/peertube-socket.service.ts2
-rw-r--r--client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.ts2
-rw-r--r--client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts3
-rw-r--r--client/src/app/shared/shared-moderation/user-ban-modal.component.ts2
15 files changed, 19 insertions, 17 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
index be1a99289..f13fe4bf9 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
@@ -260,7 +260,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
260 this.loadCategoriesAndLanguages() 260 this.loadCategoriesAndLanguages()
261 } 261 }
262 262
263 async formValidated () { 263 formValidated () {
264 const value: ComponentCustomConfig = this.form.getRawValue() 264 const value: ComponentCustomConfig = this.form.getRawValue()
265 265
266 forkJoin([ 266 forkJoin([
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 c55fc8d81..c40b36e10 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
@@ -54,7 +54,7 @@ export class FollowModalComponent extends FormReactive implements OnInit {
54 return window.location.protocol === 'https:' 54 return window.location.protocol === 'https:'
55 } 55 }
56 56
57 private async addFollowing () { 57 private addFollowing () {
58 const hostsOrHandles = splitAndGetNotEmpty(this.form.value['hostsOrHandles']) 58 const hostsOrHandles = splitAndGetNotEmpty(this.form.value['hostsOrHandles'])
59 59
60 this.followService.follow(hostsOrHandles) 60 this.followService.follow(hostsOrHandles)
diff --git a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts
index 512ceffd9..c09ce7293 100644
--- a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts
+++ b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts
@@ -134,7 +134,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit {
134 }) 134 })
135 } 135 }
136 136
137 private async removeComments (comments: VideoCommentAdmin[]) { 137 private removeComments (comments: VideoCommentAdmin[]) {
138 const commentArgs = comments.map(c => ({ videoId: c.video.id, commentId: c.id })) 138 const commentArgs = comments.map(c => ({ videoId: c.video.id, commentId: c.id }))
139 139
140 this.videoCommentService.deleteVideoComments(commentArgs) 140 this.videoCommentService.deleteVideoComments(commentArgs)
diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts
index 39caf5ed5..1030759df 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/users/user-list/user-list.component.ts
@@ -206,7 +206,7 @@ export class UserListComponent extends RestTable implements OnInit {
206 }) 206 })
207 } 207 }
208 208
209 async setEmailsAsVerified (users: User[]) { 209 setEmailsAsVerified (users: User[]) {
210 this.userService.updateUsers(users, { emailVerified: true }) 210 this.userService.updateUsers(users, { emailVerified: true })
211 .subscribe({ 211 .subscribe({
212 next: () => { 212 next: () => {
diff --git a/client/src/app/+home/home.component.ts b/client/src/app/+home/home.component.ts
index 6e0c96760..f966a2b02 100644
--- a/client/src/app/+home/home.component.ts
+++ b/client/src/app/+home/home.component.ts
@@ -15,7 +15,7 @@ export class HomeComponent implements OnInit {
15 private customPageService: CustomPageService 15 private customPageService: CustomPageService
16 ) { } 16 ) { }
17 17
18 async ngOnInit () { 18 ngOnInit () {
19 this.customPageService.getInstanceHomepage() 19 this.customPageService.getInstanceHomepage()
20 .subscribe(({ content }) => this.homepageContent = content) 20 .subscribe(({ content }) => this.homepageContent = content)
21 } 21 }
diff --git a/client/src/app/+search/search.component.ts b/client/src/app/+search/search.component.ts
index 81d1006f8..fcf6ebbec 100644
--- a/client/src/app/+search/search.component.ts
+++ b/client/src/app/+search/search.component.ts
@@ -75,7 +75,7 @@ export class SearchComponent implements OnInit, OnDestroy {
75 75
76 this.subActivatedRoute = this.route.queryParams 76 this.subActivatedRoute = this.route.queryParams
77 .subscribe({ 77 .subscribe({
78 next: async queryParams => { 78 next: queryParams => {
79 const querySearch = queryParams['search'] 79 const querySearch = queryParams['search']
80 const searchTarget = queryParams['searchTarget'] 80 const searchTarget = queryParams['searchTarget']
81 81
diff --git a/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts b/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts
index 98d66ff00..5c4152884 100644
--- a/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts
+++ b/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts
@@ -71,7 +71,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
71 return languageId && this.existingCaptions.includes(languageId) 71 return languageId && this.existingCaptions.includes(languageId)
72 } 72 }
73 73
74 async addCaption () { 74 addCaption () {
75 const languageId = this.form.value['language'] 75 const languageId = this.form.value['language']
76 const languageObject = this.videoCaptionLanguages.find(l => l.id === languageId) 76 const languageObject = this.videoCaptionLanguages.find(l => l.id === languageId)
77 77
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
index 366c93a79..bf7fdeeed 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
@@ -231,7 +231,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
231 this.sortVideoCaptions() 231 this.sortVideoCaptions()
232 } 232 }
233 233
234 async deleteCaption (caption: VideoCaptionEdit) { 234 deleteCaption (caption: VideoCaptionEdit) {
235 // Caption recovers his former state 235 // Caption recovers his former state
236 if (caption.action && this.initialVideoCaptions.includes(caption.language.id)) { 236 if (caption.action && this.initialVideoCaptions.includes(caption.language.id)) {
237 caption.action = undefined 237 caption.action = undefined
diff --git a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts
index ef5c8ed87..b1e8bf989 100644
--- a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts
@@ -21,8 +21,9 @@ export class PrivacyConcernsComponent implements OnInit {
21 private serverService: ServerService 21 private serverService: ServerService
22 ) { } 22 ) { }
23 23
24 async ngOnInit () { 24 ngOnInit () {
25 this.serverConfig = this.serverService.getHTMLConfig() 25 this.serverConfig = this.serverService.getHTMLConfig()
26
26 if ( 27 if (
27 isWebRTCDisabled() || 28 isWebRTCDisabled() ||
28 this.serverConfig.tracker.enabled === false || 29 this.serverConfig.tracker.enabled === false ||
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts
index 2007bdecb..acfd46a41 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -113,7 +113,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
113 return this.userService.getAnonymousUser() 113 return this.userService.getAnonymousUser()
114 } 114 }
115 115
116 async ngOnInit () { 116 ngOnInit () {
117 this.serverConfig = this.serverService.getHTMLConfig() 117 this.serverConfig = this.serverService.getHTMLConfig()
118 118
119 PeertubePlayerManager.initState() 119 PeertubePlayerManager.initState()
@@ -640,7 +640,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
640 } 640 }
641 641
642 if (oldVideo && oldVideo.id !== newVideo.id) { 642 if (oldVideo && oldVideo.id !== newVideo.id) {
643 await this.peertubeSocket.unsubscribeLiveVideos(oldVideo.id) 643 this.peertubeSocket.unsubscribeLiveVideos(oldVideo.id)
644 } 644 }
645 645
646 if (!newVideo.isLive) return 646 if (!newVideo.isLive) return
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index 4d5a9f75f..ae6046cc1 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -220,7 +220,7 @@ export class AppComponent implements OnInit, AfterViewInit {
220 } 220 }
221 } 221 }
222 222
223 private async openModalsIfNeeded () { 223 private openModalsIfNeeded () {
224 this.authService.userInformationLoaded 224 this.authService.userInformationLoaded
225 .pipe( 225 .pipe(
226 map(() => this.authService.getUser()), 226 map(() => this.authService.getUser()),
@@ -232,7 +232,7 @@ export class AppComponent implements OnInit, AfterViewInit {
232 ).subscribe(({ serverConfig, user }) => this._openAdminModalsIfNeeded(serverConfig, user)) 232 ).subscribe(({ serverConfig, user }) => this._openAdminModalsIfNeeded(serverConfig, user))
233 } 233 }
234 234
235 private async _openAdminModalsIfNeeded (serverConfig: ServerConfig, user: User) { 235 private _openAdminModalsIfNeeded (serverConfig: ServerConfig, user: User) {
236 if (user.noWelcomeModal !== true) return this.welcomeModal.show() 236 if (user.noWelcomeModal !== true) return this.welcomeModal.show()
237 237
238 if (user.noInstanceConfigWarningModal === true || !serverConfig.signup.allowed) return 238 if (user.noInstanceConfigWarningModal === true || !serverConfig.signup.allowed) return
diff --git a/client/src/app/core/notification/peertube-socket.service.ts b/client/src/app/core/notification/peertube-socket.service.ts
index eab1c63f2..50d5df68f 100644
--- a/client/src/app/core/notification/peertube-socket.service.ts
+++ b/client/src/app/core/notification/peertube-socket.service.ts
@@ -38,7 +38,7 @@ export class PeerTubeSocket {
38 this.liveVideosSocket.emit('subscribe', { videoId }) 38 this.liveVideosSocket.emit('subscribe', { videoId })
39 } 39 }
40 40
41 async unsubscribeLiveVideos (videoId: number) { 41 unsubscribeLiveVideos (videoId: number) {
42 if (!this.liveVideosSocket) return 42 if (!this.liveVideosSocket) return
43 43
44 this.liveVideosSocket.emit('unsubscribe', { videoId }) 44 this.liveVideosSocket.emit('unsubscribe', { videoId })
diff --git a/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.ts b/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.ts
index ccb0c5262..2600da8da 100644
--- a/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.ts
+++ b/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.ts
@@ -49,7 +49,7 @@ export class ModerationCommentModalComponent extends FormReactive implements OnI
49 this.form.reset() 49 this.form.reset()
50 } 50 }
51 51
52 async banUser () { 52 banUser () {
53 const moderationComment: string = this.form.value['moderationComment'] 53 const moderationComment: string = this.form.value['moderationComment']
54 54
55 this.abuseService.updateAbuse(this.abuseToComment, { moderationComment }) 55 this.abuseService.updateAbuse(this.abuseToComment, { moderationComment })
diff --git a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts
index e7e34ce1e..a8cc9b593 100644
--- a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts
+++ b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts
@@ -84,8 +84,9 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy {
84 84
85 this.modalService.open(this.modal, { 85 this.modalService.open(this.modal, {
86 centered: true, 86 centered: true,
87 beforeDismiss: async () => { 87 beforeDismiss: () => {
88 this.onModalDismiss() 88 this.onModalDismiss()
89
89 return true 90 return true
90 } 91 }
91 }) 92 })
diff --git a/client/src/app/shared/shared-moderation/user-ban-modal.component.ts b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts
index 0a2d5e93a..a03bd7286 100644
--- a/client/src/app/shared/shared-moderation/user-ban-modal.component.ts
+++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts
@@ -43,7 +43,7 @@ export class UserBanModalComponent extends FormReactive implements OnInit {
43 this.openedModal.close() 43 this.openedModal.close()
44 } 44 }
45 45
46 async banUser () { 46 banUser () {
47 const reason = this.form.value['reason'] || undefined 47 const reason = this.form.value['reason'] || undefined
48 48
49 this.userService.banUsers(this.usersToBan, reason) 49 this.userService.banUsers(this.usersToBan, reason)