Fix sonarjs no-duplicated-branches

This commit is contained in:
Bill Thornton 2022-10-04 17:31:48 -04:00
parent ad5c1ab018
commit 554cd1210c
8 changed files with 21 additions and 54 deletions

View file

@ -61,31 +61,20 @@ function fetchData(instance) {
function onTimerChangedExternally(e, apiClient, data) {
const options = this.options;
let refresh = false;
if (data.Id && this.TimerId === data.Id) {
refresh = true;
} else if (data.ProgramId && options && options.programId === data.ProgramId) {
refresh = true;
}
if (refresh) {
if ((data.Id && this.TimerId === data.Id)
|| (data.ProgramId && options && options.programId === data.ProgramId)
) {
this.refresh();
}
}
function onSeriesTimerChangedExternally(e, apiClient, data) {
const options = this.options;
let refresh = false;
if (data.Id && this.SeriesTimerId === data.Id) {
refresh = true;
}
if (data.ProgramId && options && options.programId === data.ProgramId) {
refresh = true;
}
if (refresh) {
if ((data.Id && this.SeriesTimerId === data.Id)
|| (data.ProgramId && options && options.programId === data.ProgramId)
) {
this.refresh();
}
}