Commit 3fe7d246 authored by Romain Casati's avatar Romain Casati
Browse files

Check for localStorage instead of just Storage.

parent 113d2039
Pipeline #417154 passed with stages
in 3 minutes and 23 seconds
......@@ -3036,7 +3036,7 @@ define([
* Saving the notebook to local storage.
*/
Notebook.prototype.saveToStorage = function () {
if (typeof(Storage) !== "undefined") {
if (typeof(localStorage) !== "undefined") {
console.log("Saving notebook to local storage");
window.localStorage.setItem(this._lsKey,
JSON.stringify(this.toIpynb()));
......@@ -3061,7 +3061,7 @@ define([
* Loading the notebook from local storage.
*/
Notebook.prototype.loadFromStorage = function () {
if (typeof(Storage) !== "undefined") {
if (typeof(localStorage) !== "undefined") {
const json = window.localStorage.getItem(this._lsKey);
if( json ) {
this.load(JSON.parse(json));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment