Commit d45f0611 authored by Romain Casati's avatar Romain Casati
Browse files

Local storage backup can fail. Now it's catched.

parent 1a6bee22
Pipeline #431282 passed with stages
in 3 minutes and 20 seconds
......@@ -3038,8 +3038,12 @@ define([
Notebook.prototype.saveToStorage = function () {
if( window.localStorage != null ) {
console.log("Saving notebook to local storage");
window.localStorage.setItem(this._lsKey,
JSON.stringify(this.toIpynb()));
try {
window.localStorage.setItem(this._lsKey,
JSON.stringify(this.toIpynb()));
} catch (e) {
console.log("Can't save to local storage! Notebook may be too big.");
}
} else {
console.warn("Local storage not supported");
}
......
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