File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
sources/new-conversation-rating-added Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @pipedream/intercom" ,
3- "version" : " 0.6.0 " ,
3+ "version" : " 0.6.1 " ,
44 "description" : " Pipedream Intercom Components" ,
55 "main" : " intercom.app.mjs" ,
66 "keywords" : [
Original file line number Diff line number Diff line change @@ -5,9 +5,18 @@ export default {
55 key : "intercom-new-conversation-rating-added" ,
66 name : "New Conversation Rating Added" ,
77 description : "Emit new event each time a new rating is added to a conversation." ,
8- version : "0.0.3 " ,
8+ version : "0.0.4 " ,
99 type : "source" ,
1010 dedupe : "unique" ,
11+ props : {
12+ ...common . props ,
13+ newConversationsOnly : {
14+ type : "boolean" ,
15+ label : "New Conversations Only" ,
16+ description : "Set to `true` to only emit events for new conversations" ,
17+ optional : true ,
18+ } ,
19+ } ,
1120 methods : {
1221 ...common . methods ,
1322 generateMeta ( conversation ) {
@@ -34,8 +43,10 @@ export default {
3443 const createdAt = conversation . conversation_rating . created_at ;
3544 if ( createdAt > lastRatingCreatedAt )
3645 lastRatingCreatedAt = createdAt ;
37- const meta = this . generateMeta ( conversation ) ;
38- this . $emit ( conversation , meta ) ;
46+ if ( ! this . newConversationsOnly || conversation . created_at > lastRatingCreatedAt ) {
47+ const meta = this . generateMeta ( conversation ) ;
48+ this . $emit ( conversation , meta ) ;
49+ }
3950 }
4051
4152 this . _setLastUpdate ( lastRatingCreatedAt ) ;
You can’t perform that action at this time.
0 commit comments