File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -28,18 +28,24 @@ export default Route.extend(ApplicationRouteMixin, {
28
28
async model ( ) {
29
29
let notifications = [ ] ;
30
30
if ( this . get ( 'session.isAuthenticated' ) ) {
31
- notifications = await this . authManager . currentUser . query ( 'notifications' , {
32
- filter : [
33
- {
34
- name : 'is-read' ,
35
- op : 'eq' ,
36
- val : false
37
- }
38
- ] ,
39
- sort : '-received-at'
40
- } ) ;
31
+ try {
32
+ notifications = await this . authManager . currentUser . query ( 'notifications' , {
33
+ filter : [
34
+ {
35
+ name : 'is-read' ,
36
+ op : 'eq' ,
37
+ val : false
38
+ }
39
+ ] ,
40
+ sort : '-received-at'
41
+ } ) ;
42
+ } catch ( e ) {
43
+ console . warn ( e ) ;
44
+ this . session . invalidate ( ) ;
45
+ }
41
46
}
42
47
48
+
43
49
return {
44
50
notifications,
45
51
pages : await this . store . query ( 'page' , {
You can’t perform that action at this time.
0 commit comments