feat: Add chatwoot:error sdk event (#3998)

This commit is contained in:
Muhsin Keloth
2022-02-21 09:40:11 +05:30
committed by GitHub
parent 3b015d4dd8
commit 7ba24b90c4
12 changed files with 59 additions and 29 deletions

View File

@@ -1,5 +1,6 @@
import { IFrameHelper } from 'widget/helpers/utils';
import ContactsAPI from '../../api/contacts';
import { SET_USER_ERROR } from '../../constants/errorTypes';
const state = {
currentUser: {},
};
@@ -38,7 +39,14 @@ export const actions = {
dispatch('conversation/fetchOldConversations', {}, { root: true });
}
} catch (error) {
// Ignore error
const {
response: { data },
} = error;
IFrameHelper.sendMessage({
event: 'error',
errorType: SET_USER_ERROR,
data,
});
}
},
setCustomAttributes: async (_, customAttributes = {}) => {