DEV: Preload prompt list on component initialization (#165)

This commit is contained in:
Keegan George
2023-08-28 12:22:44 -07:00
committed by GitHub
parent 6e01b2c334
commit b470692409
@@ -62,6 +62,15 @@ export default class AiHelperContextMenu extends Component {
@tracked _dEditorInput;
@tracked _contextMenu;
constructor() {
super(...arguments);
// Fetch prompts only if it hasn't been fetched yet
if (this.helperOptions.length === 0) {
this.loadPrompts();
}
}
willDestroy() {
super.willDestroy(...arguments);
document.removeEventListener("selectionchange", this.selectionChanged);