mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
Hide QuickConnect options when not available
This commit is contained in:
parent
4a516337b5
commit
05b0a2518e
@ -37,8 +37,8 @@
|
||||
<button is="emby-button" type="button" class="raised cancel block btnManual">
|
||||
<span>${ButtonManualLogin}</span>
|
||||
</button>
|
||||
|
||||
<button is="emby-button" type="button" class="raised cancel block btnQuick">
|
||||
|
||||
<button is="emby-button" type="button" class="raised cancel block btnQuick hide">
|
||||
<span>${ButtonUseQuickConnect}</span>
|
||||
</button>
|
||||
|
||||
|
@ -263,6 +263,17 @@ import toast from '../../../components/toast/toast';
|
||||
}
|
||||
|
||||
const apiClient = getApiClient();
|
||||
|
||||
apiClient.getQuickConnect('Status')
|
||||
.then(status => {
|
||||
if (status !== 'Unavailable') {
|
||||
view.querySelector('.btnQuick').classList.remove('hide');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
console.debug('Failed to get QuickConnect status');
|
||||
});
|
||||
|
||||
apiClient.getPublicUsers().then(function (users) {
|
||||
if (users.length) {
|
||||
showVisualForm();
|
||||
|
@ -49,7 +49,7 @@
|
||||
</a>
|
||||
|
||||
|
||||
<a is="emby-linkbutton" data-ripple="false" href="#" style="display:block;padding:0;margin:0;" class="lnkQuickConnectPreferences listItem-border">
|
||||
<a is="emby-linkbutton" data-ripple="false" href="#" style="display:block;padding:0;margin:0;" class="lnkQuickConnectPreferences listItem-border hide">
|
||||
<div class="listItem">
|
||||
<em class="material-icons listItemIcon listItemIcon-transparent">tap_and_play</em>
|
||||
<div class="listItemBody">
|
||||
|
@ -41,6 +41,16 @@ export default function (view, params) {
|
||||
page.querySelector('.selectServer').classList.add('hide');
|
||||
}
|
||||
|
||||
ApiClient.getQuickConnect('Status')
|
||||
.then(status => {
|
||||
if (status !== 'Unavailable') {
|
||||
page.querySelector('.lnkQuickConnectPreferences').classList.remove('hide');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
console.debug('Failed to get QuickConnect status');
|
||||
});
|
||||
|
||||
ApiClient.getUser(userId).then(function (user) {
|
||||
page.querySelector('.headerUsername').innerHTML = user.Name;
|
||||
if (user.Policy.IsAdministrator && !layoutManager.tv) {
|
||||
|
Loading…
Reference in New Issue
Block a user