Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Fix kiosk option
Browse files Browse the repository at this point in the history
  • Loading branch information
maykar authored Nov 7, 2020
1 parent ea894cb commit cefc135
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions kiosk-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ function kiosk_mode() {
hide_sidebar = queryStringsSet ? hide_sidebar : config.kiosk || config.hide_sidebar;

if (adminConf && hass.user.is_admin) {
hide_header = adminConf.kiosk_mode || adminConf.hide_header;
hide_sidebar = adminConf.kiosk_mode || adminConf.hide_sidebar;
hide_header = adminConf.kiosk || adminConf.hide_header;
hide_sidebar = adminConf.kiosk || adminConf.hide_sidebar;
}

if (nonAdminConf && !hass.user.is_admin) {
hide_header = nonAdminConf.kiosk_mode || nonAdminConf.hide_header;
hide_sidebar = nonAdminConf.kiosk_mode || nonAdminConf.hide_sidebar;
hide_header = nonAdminConf.kiosk || nonAdminConf.hide_header;
hide_sidebar = nonAdminConf.kiosk || nonAdminConf.hide_sidebar;
}

if (userConf) {
Expand All @@ -80,8 +80,9 @@ function kiosk_mode() {
let users = conf.users;
if (!Array.isArray(conf.users)) users = [users];
if (users.map((u) => u.toLowerCase().includes(hass.user.name.toLowerCase()))) {
hide_header = conf.kiosk_mode || conf.hide_header;
hide_sidebar = conf.kiosk_mode || conf.hide_sidebar;
console.log(conf.kiosk || conf.hide_header)
hide_header = conf.kiosk || conf.hide_header;
hide_sidebar = conf.kiosk || conf.hide_sidebar;
}
}
}
Expand Down

0 comments on commit cefc135

Please sign in to comment.