@@ -21,17 +21,23 @@ export default Route.extend(AuthenticatedRouteMixin, CanMixin, {
2121 }
2222 } ,
2323
24- async model ( ) {
24+ async model ( params ) {
2525 let project = this . modelFor ( 'project' ) ;
2626 let projectId = get ( project , 'id' ) ;
2727 let store = get ( this , 'store' ) ;
28- // peekAll returns a live array, so it will alse render any newly created
29- // messages, causing the list to update properly on project.messages.new
30- await store . query ( 'conversation' , { project_id : projectId } ) ;
31- let conversations = store . peekAll ( 'conversation' ) ;
28+ let conversations = await store . query ( 'conversation' , {
29+ project_id : projectId ,
30+ status : params . status
31+ } ) ;
3232 return { conversations, project } ;
3333 } ,
3434
35+ queryParams : {
36+ status : {
37+ refreshModel : true
38+ }
39+ } ,
40+
3541 renderTemplate ( ) {
3642 this . render ( 'project/conversations' , { into : 'application' } ) ;
3743 } ,
@@ -64,6 +70,15 @@ export default Route.extend(AuthenticatedRouteMixin, CanMixin, {
6470 this . _super ( ...arguments ) ;
6571 get ( this , 'conversations' ) . activate ( ) ;
6672 return true ;
73+ } ,
74+
75+ loading ( transition ) {
76+ let controller = this . controllerFor ( 'project.conversations' ) ;
77+ controller . set ( 'currentlyLoading' , true ) ;
78+ transition . promise . finally ( ( ) => {
79+ controller . set ( 'currentlyLoading' , false ) ;
80+ this . transitionTo ( 'project.conversations.index' ) ;
81+ } ) ;
6782 }
6883 }
6984} ) ;
0 commit comments