Remove useless abstractions and hardcoded text for toasts

This commit is contained in:
Bill Thornton 2021-05-26 13:12:19 -04:00
parent 5d76722a27
commit 3272d12f64
6 changed files with 10 additions and 20 deletions

View file

@ -225,10 +225,6 @@ function onRecordChange(e) {
}
}
function sendToast(msg) {
toast(msg);
}
function onRecordSeriesChange(e) {
this.changed = true;
@ -252,7 +248,7 @@ function onRecordSeriesChange(e) {
} else {
if (this.SeriesTimerId) {
apiClient.cancelLiveTvSeriesTimer(this.SeriesTimerId).then(function () {
sendToast(globalize.translate('RecordingCancelled'));
toast(globalize.translate('RecordingCancelled'));
fetchData(self);
});
}

View file

@ -16,7 +16,7 @@ function changeRecordingToSeries(apiClient, timerId, programId, confirmTimerCanc
return apiClient.getNewLiveTvTimerDefaults({ programId: programId }).then(function (timerDefaults) {
return apiClient.createLiveTvSeriesTimer(timerDefaults).then(function () {
loading.hide();
sendToast(globalize.translate('SeriesRecordingScheduled'));
toast(globalize.translate('SeriesRecordingScheduled'));
});
});
} else {
@ -76,7 +76,7 @@ function cancelTimer(apiClient, timerId, hideLoading) {
return apiClient.cancelLiveTvTimer(timerId).then(function () {
if (hideLoading !== false) {
loading.hide();
sendToast(globalize.translate('RecordingCancelled'));
toast(globalize.translate('RecordingCancelled'));
}
});
}
@ -90,15 +90,11 @@ function createRecording(apiClient, programId, isSeries) {
return promise.then(function () {
loading.hide();
sendToast(globalize.translate('RecordingScheduled'));
toast(globalize.translate('RecordingScheduled'));
});
});
}
function sendToast(msg) {
toast(msg);
}
function showMultiCancellationPrompt(serverId, programId, timerId, timerStatus, seriesTimerId) {
return new Promise(function (resolve, reject) {
const items = [];