I need to use join. views. toolbarButtons. create (shareButton, shareButton, ToolbarButtonLocation. EditorToolbar);
After clicking, I encountered some issues when calling join.views.dialogs based on the conditions。
If I use await hackmdDialogs. open (handle), no matter how many times I click, it will only show the following dialog box once after I click one of the buttons,It seems like there's no way to display it again
If using a method of packaging, always prompt for duplicate creation, as shown below
I am a beginner and cannot find a show method in the API dialogspanels to display or close it, or there are some issues with my code. I would like to consult everyone
async function hackmdDialogs(hmdApiClient, note, id) {
let hackmdDialogs = joplin.views.dialogs
let handle = await hackmdDialogs.create('hackmdDialog');
await hackmdDialogs.setHtml(handle, '<div><p>Note already shared on HackMD, check footer part of your note for HackMD link,<br>or remove that part to share on HackMD again.</p></div>');
await hackmdDialogs.setButtons(handle, [
{
id: 'update',
title: 'update'
},
{
id: 'delete',
title: 'delete'
},
{
id: 'cancel'
},
]);
id = (await hackmdDialogs.open(handle)).id;
console.debug("after", id);
await hackmdNote(hmdApiClient, note, id);
}