File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
components/intercom/sources/new-conversation-rating-added Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ export default {
2929 } ,
3030 } ,
3131 async run ( ) {
32- let lastRatingCreatedAt = this . _getLastUpdate ( ) ;
32+ const lastRatingCreatedAt = this . _getLastUpdate ( ) ;
33+ let maxLastRatingCreatedAt = lastRatingCreatedAt ;
3334 const data = {
3435 query : {
3536 field : "conversation_rating.requested_at" ,
@@ -41,14 +42,14 @@ export default {
4142 const results = await this . intercom . searchConversations ( data ) ;
4243 for ( const conversation of results ) {
4344 const createdAt = conversation . conversation_rating . created_at ;
44- if ( createdAt > lastRatingCreatedAt )
45- lastRatingCreatedAt = createdAt ;
45+ if ( createdAt > maxLastRatingCreatedAt )
46+ maxLastRatingCreatedAt = createdAt ;
4647 if ( ! this . newConversationsOnly || conversation . created_at > lastRatingCreatedAt ) {
4748 const meta = this . generateMeta ( conversation ) ;
4849 this . $emit ( conversation , meta ) ;
4950 }
5051 }
5152
52- this . _setLastUpdate ( lastRatingCreatedAt ) ;
53+ this . _setLastUpdate ( maxLastRatingCreatedAt ) ;
5354 } ,
5455} ;
You can’t perform that action at this time.
0 commit comments