Skip to content

Commit

Permalink
Update chatbot-extension.imjoy.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanguage authored Mar 1, 2024
1 parent c7669d7 commit ce36f42
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions public/chatbot-extension.imjoy.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@
const chatbot = api
await this.registerExtensions(chatbot.registerChatbotExtension)
} else {
const chatbot = await api.getWindow("BioImage.IO Chatbot")
let chatbot = await api.getWindow("BioImage.IO Chatbot")
if (chatbot) {
await this.registerExtensions(chatbot.registerExtension)
} else {
chatbot = await api.createWindow({src: "https://chat.bioimage.io/public/apps/bioimageio-chatbot-client/chat", name: "BioImage.IO Chatbot"})
await this.registerExtensions(chatbot.registerExtension)
}
let ij = await api.getWindow("ImageJ.JS")
if (!ij) {
ij = await api.createWindow({src: "https://ij.imjoy.io/", name: "ImageJ.JS"})
}
}
}
Expand Down Expand Up @@ -101,16 +108,7 @@
api.log('initialized')
}

async run(ctx) {
let chatbot = await api.getWindow("BioImage.IO Chatbot");
if (!chatbot) {
chatbot = await api.createWindow({
src: "https://staging.chat.bioimage.io/public/apps/bioimageio-chatbot-client/index",
name: "BioImage.IO Chatbot",
});
}
await this.registerExtensions(chatbot.registerExtension);
}
async run(ctx) { }
}

api.export(new ImJoyPlugin())
Expand Down

0 comments on commit ce36f42

Please sign in to comment.