conditional callback

This commit is contained in:
Mo Bitar
2016-12-30 13:07:20 -06:00
parent 4d02147203
commit 0821053880
3 changed files with 7 additions and 3 deletions

View File

@@ -219,7 +219,9 @@ angular.module('app.frontend')
this.syncWithOptions = function(callback, options = {}) { this.syncWithOptions = function(callback, options = {}) {
if(!this.user.uuid) { if(!this.user.uuid) {
this.writeItemsToLocalStorage(); this.writeItemsToLocalStorage();
callback(); if(callback) {
callback();
}
return; return;
} }

View File

@@ -1750,7 +1750,9 @@ var User = function User(json_obj) {
if (!this.user.uuid) { if (!this.user.uuid) {
this.writeItemsToLocalStorage(); this.writeItemsToLocalStorage();
callback(); if (callback) {
callback();
}
return; return;
} }

File diff suppressed because one or more lines are too long