(js) Fix id assignation of new Calendar

pull/229/merge
Francis Lachapelle 2018-08-31 09:36:21 -04:00
parent eeec8328c0
commit 1e784e4590
1 changed files with 3 additions and 0 deletions

View File

@ -386,6 +386,8 @@
* @returns a promise of the calendar id
*/
Calendar.prototype.$id = function() {
var _this = this;
if (this.id) {
// Object already unwrapped
return Calendar.$q.when(this.id);
@ -393,6 +395,7 @@
else {
// Wait until object is unwrapped
return this.$futureCalendarData.then(function(calendar) {
_this.id = calendar.id;
return calendar.id;
});
}