This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Plugin not working for non-admin users #12
Comments
+1 have the same issue |
Same issue here! |
Took a look myself as I had the same issue, Let me know if the below works for you as well (because I am not sure if media-browser is a default), this is a full drop in for the getSidebarItem function:
|
XxInvictus
added a commit
to XxInvictus/custom-sidebar-v2
that referenced
this issue
Jan 17, 2023
Fixing issue highlighted in galloween#12 where non-admin users do not have a config data-panel. If undefined it will instead use media-browser as the last element.
Also logged a PR with the above, though it may need cleaning up this was a 5-second fix and could probably be cleaner 👍 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, first of all thanks for refactoring this plugin and make it working with the latest version of HA :-)
I noticed everything works fine for admin users but not for non administrators. The issue seems related to
getSidebarItem()
when called upon startup returningundefined
since looking for "data-panel
" equals to "config
" which is not there for a non admin user (https://github.com/galloween/custom-sidebar-v2/blob/main/dist/custom-sidebar-v2.js#L145).As a workaround a tried picking up the latest element (e.g.
.at(-1)
) ofwindow.$customSidebarV2.SideBarElement
which works but I'm sure it breaks out other things.Thanks!
The text was updated successfully, but these errors were encountered: