Add check that SyncPlay plugin is enabled
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user