Refactor code diff apply message flow
This commit is contained in:
parent
2c01f5c5ba
commit
85c9860719
@ -9,11 +9,7 @@ class APIUtil {
|
||||
|
||||
|
||||
constructor() {
|
||||
window.onCodeDiffApply = () => {
|
||||
const e = 'code_diff_apply'
|
||||
this.createEvent({name: e, value: e})
|
||||
};
|
||||
console.log("Registered onCodeDiffApply");
|
||||
console.log("APIUtil ready");
|
||||
}
|
||||
|
||||
public static getInstance(): APIUtil {
|
||||
|
@ -329,6 +329,9 @@ class IdeaBridge {
|
||||
case "updateSetting/response":
|
||||
this.resviceUpdateSetting(res);
|
||||
break;
|
||||
case "codeDiffApply/response":
|
||||
this.resviceCodeDiffApply(res);
|
||||
break;
|
||||
case "sendUserMessage/response":
|
||||
this.resviceSendUserMessage(res);
|
||||
break;
|
||||
@ -377,6 +380,10 @@ class IdeaBridge {
|
||||
this.executeHandlers("updateSetting", res.payload);
|
||||
}
|
||||
|
||||
resviceCodeDiffApply(res) {
|
||||
this.executeHandlers("codeDiffApply", res.payload);
|
||||
}
|
||||
|
||||
resviceSendUserMessage(res) {
|
||||
this.executeHandlers("chatWithDevChat", {
|
||||
command: "chatWithDevChat",
|
||||
|
@ -174,6 +174,10 @@ export const ChatStore = types
|
||||
self.currentMessage = "";
|
||||
const config = getParent<RootInstance>(self).config
|
||||
const chatModel = config.getDefaultModel();
|
||||
messageUtil.registerHandler("codeDiffApply", (_: any) => {
|
||||
const e = 'code_diff_apply'
|
||||
APIUtil.createEvent({name: e, value: e})
|
||||
})
|
||||
messageUtil.sendMessage({
|
||||
command: "sendMessage",
|
||||
text: text,
|
||||
|
Loading…
x
Reference in New Issue
Block a user