Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Serafin-dev committed Oct 11, 2024
1 parent 859d76d commit 6ae9151
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lms/static/js/edxnotes/plugins/llm_summarize.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
annotator.subscribe('annotationEditorHidden', this.cleanupSummarize);
},
handleSummarize: function (editor, annotation) {
if (!editor.options || !editor.options.isSummarizing) return;
// if (!editor.options || !editor.options.isSummarizing) return;
if (!editor.options?.isSummarizing) return;

function toggleLoader() {
const saveButton = document.querySelector('.annotator-controls .annotator-save');
Expand All @@ -115,7 +116,8 @@
},
body: JSON.stringify({
text_to_summarize: annotation.quote,
course_id: editor.options && editor.options.llmSummarize && editor.options.llmSummarize.courseId,
course_id: editor.options?.llmSummarize?.courseId,
// course_id: editor.options && editor.options.llmSummarize && editor.options.llmSummarize.courseId,
}),
});

Expand Down
6 changes: 4 additions & 2 deletions lms/static/js/edxnotes/views/notes_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@
}
},
llmSummarize: {
isEnabled: params && params.llmSummarize && params.llmSummarize.isEnabled,
courseId: params && params.llmSummarize && params.llmSummarize.courseId,
// isEnabled: params && params.llmSummarize && params.llmSummarize.isEnabled,
// courseId: params && params.llmSummarize && params.llmSummarize.courseId,
isEnabled: params?.llmSummarize?.isEnabled,
courseId: params?.llmSummarize?.courseId,
},
};
};
Expand Down

0 comments on commit 6ae9151

Please sign in to comment.