Merge pull request #2942 from FinnStutzenstein/Issue2864

check if startup promise is resolved
This commit is contained in:
Norman Jäckel 2017-02-10 14:25:19 +01:00 committed by GitHub
commit 97de8cf785

View File

@ -101,9 +101,10 @@ angular.module('OpenSlidesApp.core', [
_.forEach(Autoupdate.messageReceivers, function (receiver) {
receiver(event.data);
});
// The first message is done: resolve the promise.
// TODO: check whether the promise is already resolved.
// Check if the promise is not resolved yet.
if (Autoupdate.firstMessageDeferred.promise.$$state.status === 0) {
Autoupdate.firstMessageDeferred.resolve();
}
};
};
return Autoupdate;