mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix sonarjs no-identical-functions
This commit is contained in:
parent
8472112951
commit
4972f50a06
8 changed files with 45 additions and 94 deletions
|
@ -747,14 +747,7 @@ import confirm from '../../components/confirm/confirm';
|
|||
console.debug('onServerRestarting not implemented', evt, apiClient);
|
||||
}
|
||||
|
||||
function onPackageInstalling(evt, apiClient) {
|
||||
if (apiClient.serverId() === serverId) {
|
||||
pollForInfo(view, apiClient);
|
||||
reloadSystemInfo(view, apiClient);
|
||||
}
|
||||
}
|
||||
|
||||
function onPackageInstallationCompleted(evt, apiClient) {
|
||||
function onPackageInstall(_, apiClient) {
|
||||
if (apiClient.serverId() === serverId) {
|
||||
pollForInfo(view, apiClient);
|
||||
reloadSystemInfo(view, apiClient);
|
||||
|
@ -786,8 +779,8 @@ import confirm from '../../components/confirm/confirm';
|
|||
Events.on(serverNotifications, 'RestartRequired', onRestartRequired);
|
||||
Events.on(serverNotifications, 'ServerShuttingDown', onServerShuttingDown);
|
||||
Events.on(serverNotifications, 'ServerRestarting', onServerRestarting);
|
||||
Events.on(serverNotifications, 'PackageInstalling', onPackageInstalling);
|
||||
Events.on(serverNotifications, 'PackageInstallationCompleted', onPackageInstallationCompleted);
|
||||
Events.on(serverNotifications, 'PackageInstalling', onPackageInstall);
|
||||
Events.on(serverNotifications, 'PackageInstallationCompleted', onPackageInstall);
|
||||
Events.on(serverNotifications, 'Sessions', onSessionsUpdate);
|
||||
Events.on(serverNotifications, 'ScheduledTasksInfo', onScheduledTasksUpdate);
|
||||
DashboardPage.lastAppUpdateCheck = null;
|
||||
|
@ -824,8 +817,8 @@ import confirm from '../../components/confirm/confirm';
|
|||
Events.off(serverNotifications, 'RestartRequired', onRestartRequired);
|
||||
Events.off(serverNotifications, 'ServerShuttingDown', onServerShuttingDown);
|
||||
Events.off(serverNotifications, 'ServerRestarting', onServerRestarting);
|
||||
Events.off(serverNotifications, 'PackageInstalling', onPackageInstalling);
|
||||
Events.off(serverNotifications, 'PackageInstallationCompleted', onPackageInstallationCompleted);
|
||||
Events.off(serverNotifications, 'PackageInstalling', onPackageInstall);
|
||||
Events.off(serverNotifications, 'PackageInstallationCompleted', onPackageInstall);
|
||||
Events.off(serverNotifications, 'Sessions', onSessionsUpdate);
|
||||
Events.off(serverNotifications, 'ScheduledTasksInfo', onScheduledTasksUpdate);
|
||||
|
||||
|
|
|
@ -1204,17 +1204,6 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components
|
|||
resetIdle();
|
||||
}
|
||||
|
||||
function onWindowTouchStart(e) {
|
||||
clickedElement = e.target;
|
||||
mouseIsDown = true;
|
||||
resetIdle();
|
||||
}
|
||||
|
||||
function onWindowTouchEnd() {
|
||||
mouseIsDown = false;
|
||||
resetIdle();
|
||||
}
|
||||
|
||||
function onWindowDragEnd() {
|
||||
// mousedown -> dragstart -> dragend !!! no mouseup :(
|
||||
mouseIsDown = false;
|
||||
|
@ -1370,12 +1359,12 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components
|
|||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
dom.addEventListener(window, 'touchstart', onWindowTouchStart, {
|
||||
dom.addEventListener(window, 'touchstart', onWindowMouseDown, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
['touchend', 'touchcancel'].forEach((event) => {
|
||||
dom.addEventListener(window, event, onWindowTouchEnd, {
|
||||
dom.addEventListener(window, event, onWindowMouseUp, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
|
@ -1411,12 +1400,12 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components
|
|||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
dom.removeEventListener(window, 'touchstart', onWindowTouchStart, {
|
||||
dom.removeEventListener(window, 'touchstart', onWindowMouseDown, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
['touchend', 'touchcancel'].forEach((event) => {
|
||||
dom.removeEventListener(window, event, onWindowTouchEnd, {
|
||||
dom.removeEventListener(window, event, onWindowMouseUp, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue