* (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 () {
* @param type
*/
ExercisePlanner.prototype.changeTypeOfPeriods = function changeTypeOfPeriods(type) {
- if (this.config.currentTypeOfPeriods !== type) {
this.config.currentTypeOfPeriods = type;
this.updateGraph(this.config.currentTypeOfPeriods);
- }
};
/**