[title] add QuotaExceededError exception handling to saveConfig function
Change-Id: Idf6f1860ae1ba3caa08e7d133bda82693fe3df00
* (use localStorage)
*/
ExercisePlanner.prototype.saveConfig = function () {
- localStorage.setItem('config', JSON.stringify(this.config));
+ try {
+ localStorage.setItem('config', JSON.stringify(this.config));
+ } catch (e) {
+ if (e.code === 22) //QuotaExceededError
+ this.ui.showErrors([{name: 'Not enough memory. Please remove unnecessary files'}]);
+ }
};
ExercisePlanner.prototype.stopTraining = function () {