If there is no UID do not explode accessibility javascript
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
f7538fcc82
commit
3ac15a45ea
1 changed files with 9 additions and 1 deletions
|
@ -192,9 +192,17 @@ class AccessibilityController extends Controller {
|
||||||
* @return DataDownloadResponse
|
* @return DataDownloadResponse
|
||||||
*/
|
*/
|
||||||
public function getJavascript(): DataDownloadResponse {
|
public function getJavascript(): DataDownloadResponse {
|
||||||
|
$user = $this->userSession->getUser();
|
||||||
|
|
||||||
|
if ($user === null) {
|
||||||
|
$theme = false;
|
||||||
|
} else {
|
||||||
|
$theme = $this->config->getUserValue($user->getUID(), $this->appName, 'theme', false);
|
||||||
|
}
|
||||||
|
|
||||||
$responseJS = '(function() {
|
$responseJS = '(function() {
|
||||||
OCA.Accessibility = {
|
OCA.Accessibility = {
|
||||||
theme: ' . json_encode($this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false)) . ',
|
theme: ' . json_encode($theme) . ',
|
||||||
|
|
||||||
};
|
};
|
||||||
})();';
|
})();';
|
||||||
|
|
Loading…
Reference in a new issue