File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,18 +7,28 @@ export default {
77 const userStore = useUserStore ( )
88
99 const updateVisibility = ( ) => {
10- const role = userStore . primaryRole
11- const user = { role }
12- const allowed = canAccessCalendar ( user as any )
13- el . style . display = allowed ? '' : 'none'
10+ try {
11+ const role = userStore . primaryRole
12+ const user = { role }
13+ const allowed = canAccessCalendar ( user as any )
14+ el . style . display = allowed ? '' : 'none'
15+ } catch ( err ) {
16+ // hide on any error during evaluation
17+ el . style . display = 'none'
18+ }
1419 }
1520
1621 updateVisibility ( )
1722 // ensure reactivity has settled in test environments
1823 setTimeout ( ( ) => updateVisibility ( ) , 0 )
1924
2025 const stop = userStore . $subscribe ( ( ) => {
21- updateVisibility ( )
26+ try {
27+ updateVisibility ( )
28+ } catch ( e ) {
29+ // swallow to avoid breaking host app/tests; ensure element hidden
30+ el . style . display = 'none'
31+ }
2232 } )
2333
2434 ; ( el as any ) . __vCanCalendarStop = stop
You can’t perform that action at this time.
0 commit comments