File tree 3 files changed +22
-5
lines changed
3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 43
43
} ,
44
44
45
45
isInMySchedule : function ( id ) {
46
+ if ( ! this . app . user ) return false ;
46
47
if ( ! this . app . user . sessions ) {
47
48
this . app . user . sessions = { } ;
48
49
}
Original file line number Diff line number Diff line change @@ -196,8 +196,8 @@ <h2 class="session-title">[[session.title]]</h2>
196
196
</ div >
197
197
198
198
< iron-icon
199
- class$ ="action-icon [[_getMyScheduleIcon(session.id, app.user.sessions) ]] "
200
- icon$ ="[[_getMyScheduleIcon(session.id, app.user.sessions) ]] "
199
+ class$ ="action-icon [[myScheduleIcon ]] "
200
+ icon$ ="[[myScheduleIcon ]] "
201
201
on-tap ="toggleMyScheduleSession "
202
202
session-id$ ="[[session.id]] "
203
203
disabled$ ="[[!online]] "
@@ -270,9 +270,19 @@ <h2 class="session-title">[[session.title]]</h2>
270
270
sessionColor : {
271
271
type : String ,
272
272
value : ''
273
+ } ,
274
+
275
+ myScheduleIcon : {
276
+ type : String ,
277
+ value : 'add-circle-outline'
273
278
}
274
279
} ,
275
280
281
+ observers : [
282
+ '_getMyScheduleIcon(session.id, app.user.sessions)' ,
283
+ '_userUpdated(app.user)'
284
+ ] ,
285
+
276
286
ready : function ( ) {
277
287
this . async ( function ( ) {
278
288
this . sessionColor = this . getComputedStyleValue ( '--' + this . _generateClass ( this . session . mainTag ) ) ;
@@ -289,7 +299,13 @@ <h2 class="session-title">[[session.title]]</h2>
289
299
} ,
290
300
291
301
_getMyScheduleIcon : function ( id ) {
292
- return this . isInMySchedule ( id ) ? 'remove-circle' : 'add-circle-outline' ;
302
+ this . myScheduleIcon = this . isInMySchedule ( id ) ? 'remove-circle' : 'add-circle-outline' ;
303
+ } ,
304
+
305
+ _userUpdated : function ( user ) {
306
+ if ( ! user && this . session ) {
307
+ this . _getMyScheduleIcon ( this . session . id ) ;
308
+ }
293
309
}
294
310
} ) ;
295
311
Original file line number Diff line number Diff line change 72
72
< template is ="dom-repeat " items ="[[schedule]] " as ="day " on-dom-change ="updateCascadedNodes ">
73
73
< schedule-day
74
74
name$ ="day[[_addToValue(index, 1)]] "
75
- app ={{app}}
75
+ app =" {{app}} "
76
76
day ="[[day]] "
77
77
filters ="[[filters]] "
78
78
> </ schedule-day >
79
79
</ template >
80
80
< template is ="dom-if " if ="{{app.user}} ">
81
81
< my-schedule
82
82
name ="myschedule "
83
- app ={{app}}
83
+ app =" {{app}} "
84
84
schedule ="[[schedule]] "
85
85
> </ my-schedule >
86
86
</ template >
You can’t perform that action at this time.
0 commit comments