Skip to content

Commit

Permalink
set up kernelspec
Browse files Browse the repository at this point in the history
  • Loading branch information
rgbkrk committed Feb 15, 2018
1 parent 02d1ad5 commit 5a384fb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions applications/desktop/src/notebook/epics/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ActionsObservable, ofType } from "redux-observable";

import { readFileObservable, statObservable } from "fs-observable";

import * as Immutable from "immutable";
import { monocellNotebook, fromJS, parseNotebook } from "@nteract/commutable";
import type { Notebook, ImmutableNotebook } from "@nteract/commutable";

Expand Down Expand Up @@ -165,12 +166,16 @@ export const launchKernelWhenNotebookSetEpic = (
export const newNotebookEpic = (action$: ActionsObservable<*>) =>
action$.pipe(
ofType(actionTypes.NEW_NOTEBOOK),
switchMap(action =>
of(
switchMap(action => {
const { spec } = action.kernelSpec;

return of(
actions.setNotebook(
null,
monocellNotebook.setIn(["metadata", "kernelspec"], action.kernelSpec)
monocellNotebook
.setIn(["metadata", "kernel_info", "name"], action.kernelSpec.name)
.setIn(["metadata", "kernelspec"], Immutable.fromJS(spec))
)
)
)
);
})
);

0 comments on commit 5a384fb

Please sign in to comment.