Some small cleanups

This commit is contained in:
the-djmaze 2022-03-08 10:52:40 +01:00
parent 04f4538700
commit c0f494c758
5 changed files with 13 additions and 22 deletions

View file

@ -42,10 +42,7 @@ const
getNotificationMessage = code => {
let key = getKeyByValue(Notification, code);
if (key) {
key = i18nKey(key).replace('_NOTIFICATION', '_ERROR');
return I18N_DATA.NOTIFICATIONS[key];
}
return key ? I18N_DATA.NOTIFICATIONS[i18nKey(key).replace('_NOTIFICATION', '_ERROR')] : '';
};
export const

View file

@ -43,10 +43,8 @@ export const
clearTimer = () => {
__themeTimer = setTimeout(() => themeTrigger(SaveSettingsStep.Idle), 1000);
__themeJson = null;
};
let url = themeStyle.dataset.href.replace(/(Admin|User)\/-\/[^/]+\//, '$1/-/' + value + '/')
+ 'Json/';
},
url = themeStyle.dataset.href.replace(/(Admin|User)\/-\/[^/]+\//, '$1/-/' + value + '/') + 'Json/';
clearTimeout(__themeTimer);

View file

@ -9,17 +9,17 @@ export const ThemeStore = {
userBackgroundHash: ko.observable(''),
isMobile: ko.observable($htmlCL.contains('rl-mobile')),
populate: function(){
populate: () => {
const themes = Settings.app('themes');
this.themes(isArray(themes) ? themes : []);
this.theme(SettingsGet('Theme'));
if (!this.isMobile()) {
this.userBackgroundName(SettingsGet('UserBackgroundName'));
this.userBackgroundHash(SettingsGet('UserBackgroundHash'));
ThemeStore.themes(isArray(themes) ? themes : []);
ThemeStore.theme(SettingsGet('Theme'));
if (!ThemeStore.isMobile()) {
ThemeStore.userBackgroundName(SettingsGet('UserBackgroundName'));
ThemeStore.userBackgroundHash(SettingsGet('UserBackgroundHash'));
}
leftPanelDisabled(this.isMobile());
leftPanelDisabled(ThemeStore.isMobile());
}
};

View file

@ -67,12 +67,9 @@ abstract class AbstractConfig implements \JsonSerializable
*/
public function Get(string $sSection, string $sName, $mDefault = null)
{
$mResult = $mDefault;
if (isset($this->aData[$sSection][$sName][0]))
{
$mResult = $this->aData[$sSection][$sName][0];
}
return $mResult;
return isset($this->aData[$sSection][$sName][0])
? $this->aData[$sSection][$sName][0]
: $mDefault;
}
/**

View file

@ -17,7 +17,6 @@
font-weight: normal !important;
font-variant: normal !important;
line-height: 1;
text-transform: none !important;
speak: never;
-webkit-font-smoothing: antialiased;
}