Verified Commit 98ab5dc8 authored by Chocobozzz's avatar Chocobozzz
Browse files

Remove useless async

parent 851675c5
......@@ -89,6 +89,10 @@
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/no-use-before-define": "off",
"require-await": "off",
"@typescript-eslint/require-await": "error",
// bugged but useful
"@typescript-eslint/restrict-plus-operands": "off"
},
......
......@@ -260,7 +260,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
this.loadCategoriesAndLanguages()
}
async formValidated () {
formValidated () {
const value: ComponentCustomConfig = this.form.getRawValue()
forkJoin([
......
......@@ -54,7 +54,7 @@ export class FollowModalComponent extends FormReactive implements OnInit {
return window.location.protocol === 'https:'
}
private async addFollowing () {
private addFollowing () {
const hostsOrHandles = splitAndGetNotEmpty(this.form.value['hostsOrHandles'])
this.followService.follow(hostsOrHandles)
......
......@@ -134,7 +134,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit {
})
}
private async removeComments (comments: VideoCommentAdmin[]) {
private removeComments (comments: VideoCommentAdmin[]) {
const commentArgs = comments.map(c => ({ videoId: c.video.id, commentId: c.id }))
this.videoCommentService.deleteVideoComments(commentArgs)
......
......@@ -206,7 +206,7 @@ export class UserListComponent extends RestTable implements OnInit {
})
}
async setEmailsAsVerified (users: User[]) {
setEmailsAsVerified (users: User[]) {
this.userService.updateUsers(users, { emailVerified: true })
.subscribe({
next: () => {
......
......@@ -15,7 +15,7 @@ export class HomeComponent implements OnInit {
private customPageService: CustomPageService
) { }
async ngOnInit () {
ngOnInit () {
this.customPageService.getInstanceHomepage()
.subscribe(({ content }) => this.homepageContent = content)
}
......
......@@ -75,7 +75,7 @@ export class SearchComponent implements OnInit, OnDestroy {
this.subActivatedRoute = this.route.queryParams
.subscribe({
next: async queryParams => {
next: queryParams => {
const querySearch = queryParams['search']
const searchTarget = queryParams['searchTarget']
......
......@@ -71,7 +71,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
return languageId && this.existingCaptions.includes(languageId)
}
async addCaption () {
addCaption () {
const languageId = this.form.value['language']
const languageObject = this.videoCaptionLanguages.find(l => l.id === languageId)
......
......@@ -231,7 +231,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
this.sortVideoCaptions()
}
async deleteCaption (caption: VideoCaptionEdit) {
deleteCaption (caption: VideoCaptionEdit) {
// Caption recovers his former state
if (caption.action && this.initialVideoCaptions.includes(caption.language.id)) {
caption.action = undefined
......
......@@ -21,8 +21,9 @@ export class PrivacyConcernsComponent implements OnInit {
private serverService: ServerService
) { }
async ngOnInit () {
ngOnInit () {
this.serverConfig = this.serverService.getHTMLConfig()
if (
isWebRTCDisabled() ||
this.serverConfig.tracker.enabled === false ||
......
......@@ -113,7 +113,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
return this.userService.getAnonymousUser()
}
async ngOnInit () {
ngOnInit () {
this.serverConfig = this.serverService.getHTMLConfig()
PeertubePlayerManager.initState()
......@@ -640,7 +640,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
}
if (oldVideo && oldVideo.id !== newVideo.id) {
await this.peertubeSocket.unsubscribeLiveVideos(oldVideo.id)
this.peertubeSocket.unsubscribeLiveVideos(oldVideo.id)
}
if (!newVideo.isLive) return
......
......@@ -220,7 +220,7 @@ export class AppComponent implements OnInit, AfterViewInit {
}
}
private async openModalsIfNeeded () {
private openModalsIfNeeded () {
this.authService.userInformationLoaded
.pipe(
map(() => this.authService.getUser()),
......@@ -232,7 +232,7 @@ export class AppComponent implements OnInit, AfterViewInit {
).subscribe(({ serverConfig, user }) => this._openAdminModalsIfNeeded(serverConfig, user))
}
private async _openAdminModalsIfNeeded (serverConfig: ServerConfig, user: User) {
private _openAdminModalsIfNeeded (serverConfig: ServerConfig, user: User) {
if (user.noWelcomeModal !== true) return this.welcomeModal.show()
if (user.noInstanceConfigWarningModal === true || !serverConfig.signup.allowed) return
......
......@@ -38,7 +38,7 @@ export class PeerTubeSocket {
this.liveVideosSocket.emit('subscribe', { videoId })
}
async unsubscribeLiveVideos (videoId: number) {
unsubscribeLiveVideos (videoId: number) {
if (!this.liveVideosSocket) return
this.liveVideosSocket.emit('unsubscribe', { videoId })
......
......@@ -49,7 +49,7 @@ export class ModerationCommentModalComponent extends FormReactive implements OnI
this.form.reset()
}
async banUser () {
banUser () {
const moderationComment: string = this.form.value['moderationComment']
this.abuseService.updateAbuse(this.abuseToComment, { moderationComment })
......
......@@ -84,8 +84,9 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy {
this.modalService.open(this.modal, {
centered: true,
beforeDismiss: async () => {
beforeDismiss: () => {
this.onModalDismiss()
return true
}
})
......
......@@ -43,7 +43,7 @@ export class UserBanModalComponent extends FormReactive implements OnInit {
this.openedModal.close()
}
async banUser () {
banUser () {
const reason = this.form.value['reason'] || undefined
this.userService.banUsers(this.usersToBan, reason)
......
......@@ -86,7 +86,7 @@ class StatsCard extends Component {
this.updateInterval = setInterval(async () => {
try {
const options = this.mode === 'p2p-media-loader'
? await this.buildHLSOptions()
? this.buildHLSOptions()
: await this.buildWebTorrentOptions() // Default
this.list.innerHTML = this.getListTemplate(options)
......@@ -102,7 +102,7 @@ class StatsCard extends Component {
this.container.style.display = 'none'
}
private async buildHLSOptions () {
private buildHLSOptions () {
const p2pMediaLoader = this.player_.p2pMediaLoader()
const level = p2pMediaLoader.getCurrentLevel()
......
......@@ -184,7 +184,7 @@ export class PeertubeChunkStore extends EventEmitter {
private runCleaner () {
this.checkExpiration()
this.cleanerInterval = setInterval(async () => {
this.cleanerInterval = setInterval(() => {
this.checkExpiration()
}, PeertubeChunkStore.CLEANER_INTERVAL_MS)
}
......
......@@ -589,7 +589,7 @@ export class PeerTubeEmbed {
this.buildCSS()
await this.buildDock(videoInfo)
this.buildDock(videoInfo)
this.initializeApi()
......@@ -665,7 +665,7 @@ export class PeerTubeEmbed {
}
}
private async buildDock (videoInfo: VideoDetails) {
private buildDock (videoInfo: VideoDetails) {
if (!this.controls) return
// On webtorrent fallback, player may have been disposed
......
......@@ -47,7 +47,7 @@ window.addEventListener('load', async () => {
let playbackRates: number[] = []
let currentRate = await player.getPlaybackRate()
const updateRates = async () => {
const updateRates = () => {
const rateListEl = document.querySelector('#rate-list')
rateListEl.innerHTML = ''
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment