mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
Enable custom css on login pages until a user with it disabled logs in.
This commit is contained in:
parent
b8f8633ffd
commit
99c902a1a1
@ -217,9 +217,13 @@ function onAppReady() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
currentSettings.userIsSet().then(() => {
|
let cssHasLoadedTrigger;
|
||||||
|
const cssHasLoadedPromise = new Promise(resolve => {
|
||||||
|
cssHasLoadedTrigger = resolve;
|
||||||
|
});
|
||||||
|
|
||||||
const apiClient = ServerConnections.currentApiClient();
|
const apiClient = ServerConnections.currentApiClient();
|
||||||
if (apiClient && !currentSettings.disableCustomCss()) {
|
if (apiClient) {
|
||||||
fetch(apiClient.getUrl('Branding/Css'))
|
fetch(apiClient.getUrl('Branding/Css'))
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
@ -237,12 +241,20 @@ function onAppReady() {
|
|||||||
document.body.appendChild(style);
|
document.body.appendChild(style);
|
||||||
}
|
}
|
||||||
style.textContent = css;
|
style.textContent = css;
|
||||||
|
cssHasLoadedTrigger(style);
|
||||||
})
|
})
|
||||||
.catch(function(err) {
|
.catch(function(err) {
|
||||||
console.warn('Error applying custom css', err);
|
console.warn('Error applying custom css', err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
currentSettings.userIsSet().then(() => {
|
||||||
|
if (currentSettings.disableCustomCss()) {
|
||||||
|
cssHasLoadedPromise.then(style => {
|
||||||
|
style.textContent = '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const localCss = currentSettings.customCss();
|
const localCss = currentSettings.customCss();
|
||||||
if (localCss) {
|
if (localCss) {
|
||||||
let style = document.querySelector('#localCssBranding');
|
let style = document.querySelector('#localCssBranding');
|
||||||
|
Loading…
Reference in New Issue
Block a user