Skip to content

Commit 4d9809d

Browse files
committed
Allow session of type other than notebook.
1 parent 4b8cc28 commit 4d9809d

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

notebook/static/tree/js/sessionlist.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,18 @@ define([
7171
var len = data.length;
7272
var nb_path;
7373
for (var i=0; i<len; i++) {
74-
nb_path = data[i].notebook.path;
75-
this.sessions[nb_path] = {
76-
id: data[i].id,
77-
kernel: {
78-
name: data[i].kernel.name
79-
}
80-
};
74+
// The classic notebook only knows about sessions for notebooks,
75+
// but the server now knows about more general sessions for
76+
// things like consoles.
77+
if (data[i].type === 'notebook') {
78+
nb_path = data[i].notebook.path;
79+
this.sessions[nb_path] = {
80+
id: data[i].id,
81+
kernel: {
82+
name: data[i].kernel.name
83+
}
84+
};
85+
}
8186
}
8287
this.events.trigger('sessions_loaded.Dashboard', this.sessions);
8388
};

0 commit comments

Comments
 (0)