Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/SIL.XForge.Scripture/ClientApp/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class AppComponent extends DataLoadingComponent implements OnInit, OnDest
// Check authentication when coming back online
// This is also run on first load when the websocket connects for the first time
if (status && !this.isAppLoading) {
this.authService.checkOnlineAuth();
void this.authService.checkOnlineAuth();
}
});

Expand Down Expand Up @@ -280,7 +280,7 @@ export class AppComponent extends DataLoadingComponent implements OnInit, OnDest
if (this._selectedProjectDoc == null || !this._selectedProjectDoc.isLoaded) {
return;
}
this.userService.setCurrentProjectId(this.currentUserDoc!, this._selectedProjectDoc.id);
void this.userService.setCurrentProjectId(this.currentUserDoc!, this._selectedProjectDoc.id);
this.projectUserConfigDoc = await this.projectService.getUserConfig(
this._selectedProjectDoc.id,
this.currentUserDoc!.id
Expand All @@ -292,7 +292,7 @@ export class AppComponent extends DataLoadingComponent implements OnInit, OnDest
// handle remotely deleted project
const userDoc = this.currentUserDoc;
if (userDoc != null && this.userService.currentProjectId(userDoc) != null) {
this.showProjectDeletedDialog();
void this.showProjectDeletedDialog();
}
});

Expand All @@ -312,8 +312,8 @@ export class AppComponent extends DataLoadingComponent implements OnInit, OnDest
// See if the user was removed from the project
if (!(this.currentUserDoc.id in this._selectedProjectDoc.data.userRoles)) {
// The user has been removed from the project
this.showProjectDeletedDialog();
this.projectService.localDelete(this._selectedProjectDoc.id);
void this.showProjectDeletedDialog();
void this.projectService.localDelete(this._selectedProjectDoc.id);
}

if (this.projectUserConfigDoc != null) {
Expand Down Expand Up @@ -349,31 +349,31 @@ export class AppComponent extends DataLoadingComponent implements OnInit, OnDest

setLocale(locale: string): void {
this.i18n.setLocale(locale);
this.authService.updateInterfaceLanguage(locale);
void this.authService.updateInterfaceLanguage(locale);
}

changePassword(): void {
if (this.currentUser == null) {
return;
} else if (!this.isAppOnline) {
this.noticeService.show(this.i18n.translateStatic('app.action_not_available_offline'));
void this.noticeService.show(this.i18n.translateStatic('app.action_not_available_offline'));
} else {
this.authService
void this.authService
.changePassword(this.currentUser.email)
.then(() => {
this.noticeService.show(this.i18n.translateStatic('app.password_reset_email_sent'));
void this.noticeService.show(this.i18n.translateStatic('app.password_reset_email_sent'));
})
.catch(() => {
this.dialogService.message('app.cannot_change_password');
void this.dialogService.message('app.cannot_change_password');
});
}
}

editName(): void {
if (this.isAppOnline) {
this.userService.editDisplayName(false);
void this.userService.editDisplayName(false);
} else {
this.noticeService.show(this.i18n.translateStatic('app.action_not_available_offline'));
void this.noticeService.show(this.i18n.translateStatic('app.action_not_available_offline'));
}
}

Expand All @@ -394,11 +394,11 @@ export class AppComponent extends DataLoadingComponent implements OnInit, OnDest
}

installOnDevice(): void {
this.pwaService.install();
void this.pwaService.install();
}

logOut(): void {
this.authService.logOut();
void this.authService.logOut();
}

collapseDrawer(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export class ChapterAudioDialogComponent implements AfterViewInit, OnDestroy {
this.processUploadedFiles(e.dataTransfer.files);
});

this.projectService.queryAudioText(this.data.projectId, this.destroyRef).then(query => {
void this.projectService.queryAudioText(this.data.projectId, this.destroyRef).then(query => {
this.textAudioQuery = query;
this.populateExistingData();
});
Expand Down Expand Up @@ -327,7 +327,7 @@ export class ChapterAudioDialogComponent implements AfterViewInit, OnDestroy {
// if the upload fails, we need to show an error and not close the dialog
this._loadingAudio = false;
if (audioUrl == null) {
this.dialogService.message('chapter_audio_dialog.upload_failed');
void this.dialogService.message('chapter_audio_dialog.upload_failed');
return;
}

Expand Down Expand Up @@ -517,7 +517,7 @@ export class ChapterAudioDialogComponent implements AfterViewInit, OnDestroy {
}
this._editState = true;
this.timing = this.timing_processed = doc.timings;
this.fileService
void this.fileService
.findOrUpdateCache(FileType.Audio, TextAudioDoc.COLLECTION, textAudioId, doc.audioUrl)
.then(data => {
if (data == null) {
Expand All @@ -530,7 +530,7 @@ export class ChapterAudioDialogComponent implements AfterViewInit, OnDestroy {
fileName: this.i18n.localizeBook(this.data.currentBook!) + ' ' + this.data.currentChapter,
status: 'uploaded'
};
this.audioUpdate(audioAttachment);
void this.audioUpdate(audioAttachment);
});
});
}
Expand Down Expand Up @@ -559,7 +559,7 @@ export class ChapterAudioDialogComponent implements AfterViewInit, OnDestroy {
}
const isTimingFile: boolean = TIMING_FILE_EXTENSION_REGEX.test(file.name);
if (isTimingFile) {
this.prepareTimingFileUpload(file);
void this.prepareTimingFileUpload(file);
} else {
// if file is larger than 100MB, show an error
if (file.size > 100_000_000) {
Expand All @@ -574,7 +574,7 @@ export class ChapterAudioDialogComponent implements AfterViewInit, OnDestroy {
status: 'uploaded'
};

this.audioUpdate(audioAttachment);
void this.audioUpdate(audioAttachment);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export class CheckingOverviewComponent extends DataLoadingComponent implements O
}

setQuestionArchiveStatus(questionDoc: QuestionDoc, archiveStatus: boolean): void {
questionDoc.submitJson0Op(op => {
void questionDoc.submitJson0Op(op => {
op.set(q => q.isArchived, archiveStatus);
if (archiveStatus) {
op.set(q => q.dateArchived!, new Date().toJSON());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ export class CheckingAnswersComponent implements OnInit {
if (questionDoc == null) {
return;
}
this.updateQuestionDocAudioUrls();
void this.updateQuestionDocAudioUrls();
if (this.questionChangeSubscription != null) {
this.questionChangeSubscription!.unsubscribe();
}
this.questionChangeSubscription = questionDoc.remoteChanges$
.pipe(quietTakeUntilDestroyed(this.destroyRef))
.subscribe(ops => {
this.updateQuestionDocAudioUrls();
void this.updateQuestionDocAudioUrls();
// If the user hasn't added an answer yet and is able to, then
// don't hold back any incoming answers from appearing right away
// as soon as the user adds their answer.
Expand Down Expand Up @@ -367,7 +367,7 @@ export class CheckingAnswersComponent implements OnInit {
};
const dialogResponseDoc: QuestionDoc | undefined = await this.questionDialogService.questionDialog(data);
if (dialogResponseDoc?.data != null) {
this.updateQuestionDocAudioUrls();
void this.updateQuestionDocAudioUrls();
this.action.emit({ action: 'edit', questionDoc: dialogResponseDoc });
}
}
Expand Down Expand Up @@ -396,7 +396,7 @@ export class CheckingAnswersComponent implements OnInit {
result.audio.fileName
);
if (urlResult != null) {
this.questionDoc.submitJson0Op(op => op.set(q => q.audioUrl, urlResult));
void this.questionDoc.submitJson0Op(op => op.set(q => q.audioUrl, urlResult));
}
}
}
Expand Down Expand Up @@ -454,9 +454,9 @@ export class CheckingAnswersComponent implements OnInit {
answer
});
} else if (likeAnswerResponse === LikeAnswerResponse.DeniedOwnAnswer) {
this.noticeService.show(this.i18n.translateStatic('checking_answers.cannot_like_own_answer'));
void this.noticeService.show(this.i18n.translateStatic('checking_answers.cannot_like_own_answer'));
} else if (likeAnswerResponse === LikeAnswerResponse.DeniedNoPermission) {
this.noticeService.show(this.i18n.translateStatic('checking_answers.no_permission_to_like'));
void this.noticeService.show(this.i18n.translateStatic('checking_answers.no_permission_to_like'));
}
}

Expand Down Expand Up @@ -548,9 +548,9 @@ export class CheckingAnswersComponent implements OnInit {
if (this.questionDoc?.data == null) {
return;
}
this.cacheFileSource(this.questionDoc, this.questionDoc.data.dataId, this.questionDoc.data.audioUrl);
void this.cacheFileSource(this.questionDoc, this.questionDoc.data.dataId, this.questionDoc.data.audioUrl);
for (const answer of this.questionDoc.getAnswers()) {
this.cacheFileSource(this.questionDoc, answer.dataId, answer.audioUrl);
void this.cacheFileSource(this.questionDoc, answer.dataId, answer.audioUrl);
}
}

Expand Down Expand Up @@ -590,7 +590,7 @@ export class CheckingAnswersComponent implements OnInit {
this.hideAnswerForm();
this.submittingAnswer = false;
this.justEditedAnswer = true;
this.updateQuestionDocAudioUrls();
void this.updateQuestionDocAudioUrls();
}
});
}
Expand All @@ -599,7 +599,7 @@ export class CheckingAnswersComponent implements OnInit {
if (this.projectId == null) {
return;
}
this.projectService.isProjectAdmin(this.projectId, this.userService.currentUserId).then(isProjectAdmin => {
void this.projectService.isProjectAdmin(this.projectId, this.userService.currentUserId).then(isProjectAdmin => {
this.isProjectAdmin = isProjectAdmin;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class CheckingCommentsComponent extends SubscriptionDisposable implements
}
}
if (commentIdsToMarkRead.length) {
this.projectUserConfigDoc.submitJson0Op(op => {
void this.projectUserConfigDoc.submitJson0Op(op => {
for (const commentId of commentIdsToMarkRead) {
op.add(puc => puc.commentRefsRead, commentId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class CheckingQuestionsComponent implements OnInit, OnChanges {
});
this.setProjectAdmin();

this.questionsService
void this.questionsService
.queryFirstUnansweredQuestion(projectProfileDoc.id, this.userService.currentUserId, this.destroyRef)
.then(query => {
this._firstUnansweredQuestion = query;
Expand Down Expand Up @@ -325,7 +325,7 @@ export class CheckingQuestionsComponent implements OnInit, OnChanges {
return;
}

this._projectUserConfigDoc
void this._projectUserConfigDoc
.submitJson0Op(op => {
if (questionDoc != null && questionDoc.data != null && !this.hasUserReadQuestion(questionDoc)) {
op.add(puc => puc.questionRefsRead, questionDoc.data.dataId);
Expand Down Expand Up @@ -406,7 +406,7 @@ export class CheckingQuestionsComponent implements OnInit, OnChanges {
this.activeQuestionDoc = questionDoc;

if (verseRef != null) {
this.storeMostRecentQuestion().then(() => {
void this.storeMostRecentQuestion().then(() => {
// Only emit if not a filter to avoid duplicate emission, as an emit from filter is called elsewhere
if (!actionSource?.isQuestionListChange) {
this.changed.emit({ questionDoc, actionSource, clearFilter });
Expand Down Expand Up @@ -459,7 +459,7 @@ export class CheckingQuestionsComponent implements OnInit, OnChanges {
if (this.projectId == null) {
return;
}
this.projectService.isProjectAdmin(this.projectId, this.userService.currentUserId).then(isProjectAdmin => {
void this.projectService.isProjectAdmin(this.projectId, this.userService.currentUserId).then(isProjectAdmin => {
this.isProjectAdmin = isProjectAdmin;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class CheckingScriptureAudioPlayerComponent implements AfterViewInit {
if (this.audioPlayer == null) return;
this._audioIsAvailable = false;
// wait until the next microtask cycle to get the audio player with the updated source
Promise.resolve(this.audioPlayer).then(audioPlayer => {
void Promise.resolve(this.audioPlayer).then(audioPlayer => {
this.audioSubscription?.unsubscribe();
this.audioSubscription = audioPlayer.isAudioAvailable$
.pipe(
Expand Down
Loading
Loading