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

Add check that SyncPlay plugin is enabled

This commit is contained in:
Bill Thornton 2022-10-02 03:55:35 -04:00
parent 496508ee4d
commit 3a07d34884

View file

@ -9,6 +9,7 @@ import viewManager from '../components/viewManager/viewManager';
import { appRouter } from '../components/appRouter';
import { appHost } from '../components/apphost';
import { playbackManager } from '../components/playback/playbackmanager';
import { pluginManager } from '../components/pluginManager';
import groupSelectionMenu from '../plugins/syncPlay/ui/groupSelectionMenu';
import browser from './browser';
import globalize from './globalize';
@ -154,8 +155,14 @@ import '../assets/css/flexstyles.scss';
const policy = user.Policy ? user.Policy : user.localUser.Policy;
const apiClient = getCurrentApiClient();
if (headerSyncButton && policy?.SyncPlayAccess !== 'None' && apiClient.isMinServerVersion('10.6.0')) {
if (
// Button is present
headerSyncButton
// SyncPlay plugin is loaded
&& pluginManager.plugins.filter(plugin => plugin.id === 'syncplay').length > 0
// SyncPlay enabled for user
&& policy?.SyncPlayAccess !== 'None'
) {
headerSyncButton.classList.remove('hide');
}
} else {