Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "bugfix",
"description" : "change to use promptStickyCard to for image verification notification"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog not required

}
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,15 @@ class AmazonQPanel(val project: Project, private val scope: CoroutineScope) : Di
0
)

val errorJson = OBJECT_MAPPER.writeValueAsString(errorMessages)
browserInstance.jcefBrowser.cefBrowser.executeJavaScript(
"window.handleNativeNotify('$errorJson')",
browserInstance.jcefBrowser.cefBrowser.url,
0
)
if (errorMessages.isNotEmpty()) {
val errorJson = OBJECT_MAPPER.writeValueAsString(errorMessages)
browserInstance.jcefBrowser.cefBrowser.executeJavaScript(
"window.handleNativeNotify('$errorJson')",
browserInstance.jcefBrowser.cefBrowser.url,
0
)
}

dtde.dropComplete(true)
} else {
dtde.dropComplete(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,19 @@ class Browser(parent: Disposable, private val webUri: URI, val project: Project)

window.handleNativeNotify = function(errorMessages) {
const messages = JSON.parse(errorMessages);
messages.forEach(msg => {
qChat.notify({
content: msg
})
});
let message = messages.join('\n');
qChat.updateStore(qChat.getSelectedTabId(), {
promptInputStickyCard: {
messageId: 'image-verification-banner',
header: {
icon: 'warning',
iconStatus: 'warning',
body: '### Invalid Image',
},
body: message,
canBeDismissed: true,
},
})
};
}
</script>
Expand Down
Loading