Skip to content

Commit

Permalink
DEV: Preload prompt list on component initialization (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
keegangeorge committed Aug 28, 2023
1 parent 6e01b2c commit b470692
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b470692

Please sign in to comment.