Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #18908 from vicamo/bugzilla/994819/cost-control-ra…
Browse files Browse the repository at this point in the history
…cing-conditions

Bug 994819 - [Cost Control] invoke passed callbacks when everything is ready. r=salva, f=cyang
  • Loading branch information
vicamo committed May 13, 2014
2 parents e5e6b19 + 9fca829 commit 4c8c9c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 6 additions & 7 deletions apps/costcontrol/js/config/config_manager.js
Expand Up @@ -168,10 +168,9 @@ var ConfigManager = (function() {
if (settings === null) {
settings = deepCopy(DEFAULT_SETTINGS);
debug('Storing default settings for ICCID:', currentICCID);
asyncStorage.setItem(currentICCID, JSON.stringify(settings));
}

if (callback) {
asyncStorage.setItem(currentICCID, JSON.stringify(settings),
callback && callback.bind(null, settings));
} else if (callback) {
callback(settings);
}
});
Expand Down Expand Up @@ -230,10 +229,10 @@ var ConfigManager = (function() {
settings);
}
}
if (callback) {
callback();
}
});
if (callback) {
callback();
}
}
);
}
Expand Down
3 changes: 1 addition & 2 deletions apps/costcontrol/js/message_handler.js
Expand Up @@ -329,8 +329,7 @@
var title = _('data-limit-notification-title2', { limit: limitText });
var message = _('data-limit-notification-text2');
NotificationHelper.send(title, message, iconURL, goToDataUsage);
ConfigManager.setOption({ 'dataUsageNotified': true });
closeIfProceeds();
ConfigManager.setOption({ 'dataUsageNotified': true }, closeIfProceeds);
return;
});
};
Expand Down

0 comments on commit 4c8c9c1

Please sign in to comment.