File tree 1 file changed +17
-12
lines changed
1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -148,23 +148,28 @@ export class CrispService {
148
148
let totalChatOrigin = 0 ;
149
149
150
150
for ( const userEmail of userEmails ) {
151
- const conversations = await CrispClient . website . listPeopleConversations (
152
- crispWebsiteId ,
153
- userEmail ,
154
- ) ;
155
-
156
- for ( const conversation of conversations ) {
157
- const messages = await CrispClient . website . getMessagesInConversation (
151
+ try {
152
+ const conversations = await CrispClient . website . listPeopleConversations (
158
153
crispWebsiteId ,
159
- conversation ,
154
+ userEmail ,
160
155
) ;
161
156
162
- for ( const message of messages ) {
163
- if ( message . from === 'user' ) {
164
- if ( message . origin === 'chat' ) totalChatOrigin ++ ;
165
- if ( message . origin === 'email' ) totalEmailOrigin ++ ;
157
+ for ( const conversation of conversations ) {
158
+ const messages = await CrispClient . website . getMessagesInConversation (
159
+ crispWebsiteId ,
160
+ conversation ,
161
+ ) ;
162
+
163
+ for ( const message of messages ) {
164
+ if ( message . from === 'user' ) {
165
+ if ( message . origin === 'chat' ) totalChatOrigin ++ ;
166
+ if ( message . origin === 'email' ) totalEmailOrigin ++ ;
167
+ }
166
168
}
167
169
}
170
+ } catch ( error ) {
171
+ // skip
172
+ console . log ( error ) ;
168
173
}
169
174
}
170
175
const totalMessages = totalEmailOrigin + totalChatOrigin ;
You can’t perform that action at this time.
0 commit comments