Closed rajeshshettysrs closed 2 years ago
Issue solved:
Solution: window.WAPI.sendImage = function(imgBase64, chatid, filename, caption) { var idUser = new Store.WidFactory.createWid(chatid, { intentionallyUsePrivateConstructor: true }); return Store.FindChat.findChat(idUser).then((chat) => { var mediaBlob = window.WAPI.base64ImageToFile(imgBase64, filename); var mc = new Store.MediaCollection(chat); mc.processAttachments([{file: mediaBlob}, 1], chat, 1).then(() => { let media = mc.models[0]; media.sendToChat(chat, {caption:caption}); return true; }); }); }
and added below code in neededObjects
{ id: "WidFactory", conditions: (module) => (module.isWidlike && module.createWid && module.createWidFromWidLike) ? module : null }, { id: 'FindChat', conditions: (module) => (module && module.findChat) ? module : null},
When we try to send messages with attachments like image,pdf..etc for those contacts which are not stored in phone contacts using "window.WAPI.sendImage" function we are getting "javascript error: this._find is not a function" error.
Observations: We are facing this issue may be after chrome updation to V93 version.
Please help