1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix return statements

This commit is contained in:
sancodes 2022-04-08 19:10:11 -07:00
parent 161f531523
commit 27cd24f5fc
9 changed files with 53 additions and 28 deletions

View file

@ -23,7 +23,8 @@ import ServerConnections from './ServerConnections';
if (!actionableParent || actionableParent.classList.contains('cardContent')) {
apiClient.getJSON(apiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
if (items.length === 1) {
return appRouter.showItem(items[0]);
appRouter.showItem(items[0]);
return;
}
const url = 'details?id=' + itemId + '&serverId=' + serverId;

View file

@ -323,7 +323,8 @@ import template from './libraryoptionseditor.template.html';
function onImageFetchersContainerClick(e) {
const btnImageOptionsForType = dom.parentWithClass(e.target, 'btnImageOptionsForType');
if (btnImageOptionsForType) {
return showImageOptionsForType(dom.parentWithClass(btnImageOptionsForType, 'imageFetcher').getAttribute('data-type'));
showImageOptionsForType(dom.parentWithClass(btnImageOptionsForType, 'imageFetcher').getAttribute('data-type'));
return;
}
onSortableContainerClick.call(this, e);
}

View file

@ -122,9 +122,10 @@ export default function (page, providerId, options) {
const selectedListingsId = $('#selectListing', page).val();
if (!selectedListingsId) {
return Dashboard.alert({
Dashboard.alert({
message: globalize.translate('ErrorPleaseSelectLineup')
});
return;
}
loading.show();
@ -168,7 +169,8 @@ export default function (page, providerId, options) {
function refreshListings(value) {
if (!value) {
return $('#selectListing', page).html('');
$('#selectListing', page).html('');
return;
}
loading.show();

View file

@ -140,7 +140,8 @@ function renderSeriesTimerSchedule(page, apiClient, seriesTimerId) {
function renderTimerEditor(page, item, apiClient, user) {
if (item.Type !== 'Recording' || !user.Policy.EnableLiveTvManagement || !item.TimerId || item.Status !== 'InProgress') {
return hideAll(page, 'btnCancelTimer');
hideAll(page, 'btnCancelTimer');
return;
}
hideAll(page, 'btnCancelTimer', true);
@ -148,7 +149,8 @@ function renderTimerEditor(page, item, apiClient, user) {
function renderSeriesTimerEditor(page, item, apiClient, user) {
if (item.Type !== 'SeriesTimer') {
return hideAll(page, 'btnCancelSeriesTimer');
hideAll(page, 'btnCancelSeriesTimer');
return;
}
if (user.Policy.EnableLiveTvManagement) {
@ -160,11 +162,13 @@ function renderSeriesTimerEditor(page, item, apiClient, user) {
page.querySelector('.seriesTimerScheduleSection').classList.remove('hide');
hideAll(page, 'btnCancelSeriesTimer', true);
return renderSeriesTimerSchedule(page, apiClient, item.Id);
renderSeriesTimerSchedule(page, apiClient, item.Id);
return;
}
page.querySelector('.seriesTimerScheduleSection').classList.add('hide');
return hideAll(page, 'btnCancelSeriesTimer');
hideAll(page, 'btnCancelSeriesTimer');
return;
}
function renderTrackSelections(page, instance, item, forceReload) {
@ -807,7 +811,7 @@ function renderNextUp(page, item, user) {
if (item.Type != 'Series') {
section.classList.add('hide');
return undefined;
return;
}
ServerConnections.getApiClient(item.ServerId).getNextUpEpisodes({
@ -1114,7 +1118,8 @@ function renderMoreFromSeason(view, item, apiClient) {
if (section) {
if (item.Type !== 'Episode' || !item.SeasonId || !item.SeriesId) {
return section.classList.add('hide');
section.classList.add('hide');
return;
}
const userId = apiClient.getCurrentUserId();
@ -1124,7 +1129,8 @@ function renderMoreFromSeason(view, item, apiClient) {
Fields: 'ItemCounts,PrimaryImageAspectRatio,BasicSyncInfo,CanDelete,MediaSourceCount'
}).then(function (result) {
if (result.Items.length < 2) {
return section.classList.add('hide');
section.classList.add('hide');
return;
}
section.classList.remove('hide');
@ -1159,10 +1165,12 @@ function renderMoreFromArtist(view, item, apiClient) {
if (section) {
if (item.Type === 'MusicArtist') {
if (!apiClient.isMinServerVersion('3.4.1.19')) {
return section.classList.add('hide');
section.classList.add('hide');
return;
}
} else if (item.Type !== 'MusicAlbum' || !item.AlbumArtists || !item.AlbumArtists.length) {
return section.classList.add('hide');
section.classList.add('hide');
return;
}
const query = {
@ -1181,7 +1189,8 @@ function renderMoreFromArtist(view, item, apiClient) {
apiClient.getItems(apiClient.getCurrentUserId(), query).then(function (result) {
if (!result.Items.length) {
return section.classList.add('hide');
section.classList.add('hide');
return;
}
section.classList.remove('hide');
@ -1215,7 +1224,8 @@ function renderSimilarItems(page, item, context) {
if (similarCollapsible) {
if (item.Type != 'Movie' && item.Type != 'Trailer' && item.Type != 'Series' && item.Type != 'Program' && item.Type != 'Recording' && item.Type != 'MusicAlbum' && item.Type != 'MusicArtist' && item.Type != 'Playlist') {
return similarCollapsible.classList.add('hide');
similarCollapsible.classList.add('hide');
return;
}
similarCollapsible.classList.remove('hide');
@ -1232,7 +1242,8 @@ function renderSimilarItems(page, item, context) {
apiClient.getSimilarItems(item.Id, options).then(function (result) {
if (!result.Items.length) {
return similarCollapsible.classList.add('hide');
similarCollapsible.classList.add('hide');
return;
}
similarCollapsible.classList.remove('hide');
@ -1820,7 +1831,7 @@ function renderCast(page, item) {
if (!people.length) {
page.querySelector('#castCollapsible').classList.add('hide');
return undefined;
return;
}
page.querySelector('#castCollapsible').classList.remove('hide');
@ -1915,11 +1926,12 @@ export default function (view, params) {
if (item.Type === 'Program') {
const apiClient = ServerConnections.getApiClient(item.ServerId);
return apiClient.getLiveTvChannel(item.ChannelId, apiClient.getCurrentUserId()).then(function (channel) {
apiClient.getLiveTvChannel(item.ChannelId, apiClient.getCurrentUserId()).then(function (channel) {
playbackManager.play({
items: [channel]
});
});
return;
}
playItem(item, item.UserData && mode === 'resume' ? item.UserData.PlaybackPositionTicks : 0);

View file

@ -721,7 +721,7 @@ class ItemsView {
return globalize.translate('Videos');
}
return undefined;
return;
}
function play() {

View file

@ -54,14 +54,16 @@ import { appRouter } from '../../../components/appRouter';
recordingButtonManager = null;
}
return view.querySelector('.btnRecord').classList.add('hide');
view.querySelector('.btnRecord').classList.add('hide');
return;
}
ServerConnections.getApiClient(item.ServerId).getCurrentUser().then(function (user) {
if (user.Policy.EnableLiveTvManagement) {
import('../../../components/recordingcreator/recordingbutton').then(({default: RecordingButton}) => {
if (recordingButtonManager) {
return recordingButtonManager.refreshItem(item);
recordingButtonManager.refreshItem(item);
return;
}
recordingButtonManager = new RecordingButton({
@ -1449,7 +1451,8 @@ import { appRouter } from '../../../components/appRouter';
/* eslint-disable-next-line compat/compat */
dom.addEventListener(view, window.PointerEvent ? 'pointerdown' : 'click', function (e) {
if (dom.parentWithClass(e.target, ['videoOsdBottom', 'upNextContainer'])) {
return showOsd();
showOsd();
return;
}
const pointerType = e.pointerType || (layoutManager.mobile ? 'touch' : 'mouse');

View file

@ -5,17 +5,19 @@ import Dashboard from '../../../scripts/clientUtils';
function processForgotPasswordResult(result) {
if (result.Action == 'ContactAdmin') {
return Dashboard.alert({
Dashboard.alert({
message: globalize.translate('MessageContactAdminToResetPassword'),
title: globalize.translate('ButtonForgotPassword')
});
return;
}
if (result.Action == 'InNetworkRequired') {
return Dashboard.alert({
Dashboard.alert({
message: globalize.translate('MessageForgotPasswordInNetworkRequired'),
title: globalize.translate('ButtonForgotPassword')
});
return;
}
if (result.Action == 'PinCode') {
@ -26,13 +28,14 @@ import Dashboard from '../../../scripts/clientUtils';
msg += '<br/>';
msg += result.PinFile;
msg += '<br/>';
return Dashboard.alert({
Dashboard.alert({
message: msg,
title: globalize.translate('ButtonForgotPassword'),
callback: function () {
Dashboard.navigate('forgotpasswordpin.html');
}
});
return;
}
}

View file

@ -9,13 +9,14 @@ import Dashboard from '../../../scripts/clientUtils';
msg += '<br/>';
msg += '<br/>';
msg += result.UsersReset.join('<br/>');
return Dashboard.alert({
Dashboard.alert({
message: msg,
title: globalize.translate('HeaderPasswordReset'),
callback: function () {
window.location.href = 'index.html';
}
});
return;
}
Dashboard.alert({

View file

@ -645,7 +645,8 @@ import Headroom from 'headroom.js';
if (!user) {
showBySelector('.libraryMenuDownloads', false);
showBySelector('.lnkSyncToOtherDevices', false);
return showBySelector('.userMenuOptions', false);
showBySelector('.userMenuOptions', false);
return;
}
if (user.Policy.EnableContentDownloading) {
@ -957,7 +958,8 @@ import Headroom from 'headroom.js';
function setTitle (title) {
if (title == null) {
return LibraryMenu.setDefaultTitle();
LibraryMenu.setDefaultTitle();
return;
}
if (title === '-') {