Merge pull request #9278 from jryans/storage-edge-cases

Convert away from `Promise.defer`
This commit is contained in:
J. Ryan Stinnett 2019-03-26 13:26:00 +00:00 committed by GitHub
commit 2e24b0c53b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 15 deletions

View File

@ -123,9 +123,6 @@ describe('loading:', function() {
toString: function() { return this.search + this.hash; }, toString: function() { return this.search + this.hash; },
}; };
const tokenLoginCompleteDefer = Promise.defer();
tokenLoginCompletePromise = tokenLoginCompleteDefer.promise;
function onNewScreen(screen) { function onNewScreen(screen) {
console.log(Date.now() + " newscreen "+screen); console.log(Date.now() + " newscreen "+screen);
const hash = '#/' + screen; const hash = '#/' + screen;
@ -157,6 +154,8 @@ describe('loading:', function() {
PlatformPeg.set(new WebPlatform()); PlatformPeg.set(new WebPlatform());
const params = parseQs(windowLocation); const params = parseQs(windowLocation);
tokenLoginCompletePromise = new Promise(resolve => {
matrixChat = ReactDOM.render( matrixChat = ReactDOM.render(
<MatrixChat <MatrixChat
onNewScreen={onNewScreen} onNewScreen={onNewScreen}
@ -164,11 +163,12 @@ describe('loading:', function() {
realQueryParams={params} realQueryParams={params}
startingFragmentQueryParams={fragParts.params} startingFragmentQueryParams={fragParts.params}
enableGuest={true} enableGuest={true}
onTokenLoginCompleted={() => tokenLoginCompleteDefer.resolve()} onTokenLoginCompleted={resolve}
initialScreenAfterLogin={getScreenFromLocation(windowLocation)} initialScreenAfterLogin={getScreenFromLocation(windowLocation)}
makeRegistrationUrl={() => {throw new Error('Not implemented');}} makeRegistrationUrl={() => {throw new Error('Not implemented');}}
/>, parentDiv, />, parentDiv,
); );
});
} }
// set an expectation that we will get a call to /sync, then flush // set an expectation that we will get a call to /sync, then flush