Open rinwa opened 2 years ago
Callback not found. I am getting this error.
I provided the code to reproduce it. When you click on the link. You will get this error in the log file. After that links are not working.
{ message: "Error invoking remote method 'message-whisperInteraction': callback not found", stack: "Error: Error invoking remote method 'message-whisperInteraction': callback not found\n" + ' at Function. (file:///C:/Users/Sumit.Rinwa/AppData/Local/olive-helps/app-0.47.4/resources/app/.webpack/renderer/sidebar/index.js:2:1256710)' }
0.47.4
"@oliveai/ldk": "*"
Window
import { whisper } from '@oliveai/ldk'; import { WhisperComponentType } from '@oliveai/ldk/dist/whisper/types'; import { stripIndent } from 'common-tags';
export default class CopyData { constructor() { this.whisper = undefined; this.label = 'Link Info'; }
show() { whisper .create({ components: [ { body: 'All Link here', type: WhisperComponentType.Markdown, }, ], label: 'Links Info', onClose: () => { console.log('closed change info whisper'); }, }) .then((newWhisper) => { this.whisper = newWhisper; }); }
update(comp) { this.whisper.update({ label: this.label, components: [...comp], onClose: () => {}, }); }
creatingLink(allData) { let markdownLink = | Link: |\n| :----------|\n; allData.forEach((element, j) => { markdownLink += |● [${element.name}](#${j + 1})| \n; });
| Link: |\n| :----------|\n
|● [${element.name}](#${j + 1})| \n
let markdownAll = stripIndent` ${markdownLink}`; let markdown1 = { body: markdownAll, type: WhisperComponentType.Markdown, onLinkClick: (error, linkName) => { console.info(`Received click on the link: ${JSON.stringify(linkName)}`); console.info('error=============', JSON.stringify(error)); }, }; this.update([markdown1]);
} } //class end here let arr1 = [{ name: 'link1' }, { name: 'link1' }]; let arr2 = [{ name: 'link3' }, { name: 'link4' }]; let cp = new CopyData(); cp.show();
setTimeout(() => { cp.creatingLink(arr1); }, 700);
setTimeout(() => { cp.creatingLink(arr2); }, 1500);
No response
@rinwa it looks like the component loses the onLinkClick property during the update of the whisper. We'll work on getting a bug card opened to track a fix for this
Describe the bug
Callback not found. I am getting this error.
Steps to Reproduce
I provided the code to reproduce it. When you click on the link. You will get this error in the log file. After that links are not working.
{ message: "Error invoking remote method 'message-whisperInteraction': callback not found", stack: "Error: Error invoking remote method 'message-whisperInteraction': callback not found\n" + ' at Function. (file:///C:/Users/Sumit.Rinwa/AppData/Local/olive-helps/app-0.47.4/resources/app/.webpack/renderer/sidebar/index.js:2:1256710)'
}
Olive Helps Version
0.47.4
LDK Version
"@oliveai/ldk": "*"
Operating System
Window
Code Sample
import { whisper } from '@oliveai/ldk'; import { WhisperComponentType } from '@oliveai/ldk/dist/whisper/types'; import { stripIndent } from 'common-tags';
export default class CopyData { constructor() { this.whisper = undefined; this.label = 'Link Info'; }
show() { whisper .create({ components: [ { body: 'All Link here', type: WhisperComponentType.Markdown, }, ], label: 'Links Info', onClose: () => { console.log('closed change info whisper'); }, }) .then((newWhisper) => { this.whisper = newWhisper; }); }
update(comp) { this.whisper.update({ label: this.label, components: [...comp], onClose: () => {}, }); }
creatingLink(allData) { let markdownLink =
| Link: |\n| :----------|\n
; allData.forEach((element, j) => { markdownLink +=|● [${element.name}](#${j + 1})| \n
; });} } //class end here let arr1 = [{ name: 'link1' }, { name: 'link1' }]; let arr2 = [{ name: 'link3' }, { name: 'link4' }]; let cp = new CopyData(); cp.show();
setTimeout(() => { cp.creatingLink(arr1); }, 700);
setTimeout(() => { cp.creatingLink(arr2); }, 1500);
Additional Context
No response
Code of Conduct