Skip to content

Commit

Permalink
Recreate nbgrader widgets after they are disposed.
Browse files Browse the repository at this point in the history
Fixes  #1772
  • Loading branch information
ykazakov committed Apr 3, 2023
1 parent cdfbd53 commit d7d5cc9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/assignment_list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const assignment_list_extension: JupyterFrontEndPlugin<void> = {
app.commands.addCommand(command,{
label: 'Assignment List',
execute: () => {
if(!widget){
if(!widget || widget.isDisposed){
const content = new AssignmentListWidget(app);
widget = new MainAreaWidget({content});
widget.id = 'nbgrader-assignment-list';
Expand Down
2 changes: 1 addition & 1 deletion src/course_list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const course_list_extension: JupyterFrontEndPlugin<void> = {
app.commands.addCommand(command, {
label: 'Course List',
execute: () => {
if (!widget) {
if (!widget || widget.isDisposed) {
const content = new CourseListWidget(app);
widget = new MainAreaWidget({content});
widget.id = 'nbgrader-course-list'
Expand Down
2 changes: 1 addition & 1 deletion src/formgrader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const formgrader_extension: JupyterFrontEndPlugin<void> = {
app.commands.addCommand(command,{
label: 'Formgrader',
execute: async args => {
if(!widget){
if(!widget || widget.isDisposed){
const settings = ServerConnection.makeSettings();
const url = (args.url as string) || URLExt.join(settings.baseUrl, "formgrader");

Expand Down

0 comments on commit d7d5cc9

Please sign in to comment.