forked from matrix/element-web
Merge pull request #9278 from jryans/storage-edge-cases
Convert away from `Promise.defer`
This commit is contained in:
commit
2e24b0c53b
|
@ -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,18 +154,21 @@ describe('loading:', function() {
|
||||||
PlatformPeg.set(new WebPlatform());
|
PlatformPeg.set(new WebPlatform());
|
||||||
|
|
||||||
const params = parseQs(windowLocation);
|
const params = parseQs(windowLocation);
|
||||||
matrixChat = ReactDOM.render(
|
|
||||||
<MatrixChat
|
tokenLoginCompletePromise = new Promise(resolve => {
|
||||||
onNewScreen={onNewScreen}
|
matrixChat = ReactDOM.render(
|
||||||
config={config}
|
<MatrixChat
|
||||||
realQueryParams={params}
|
onNewScreen={onNewScreen}
|
||||||
startingFragmentQueryParams={fragParts.params}
|
config={config}
|
||||||
enableGuest={true}
|
realQueryParams={params}
|
||||||
onTokenLoginCompleted={() => tokenLoginCompleteDefer.resolve()}
|
startingFragmentQueryParams={fragParts.params}
|
||||||
initialScreenAfterLogin={getScreenFromLocation(windowLocation)}
|
enableGuest={true}
|
||||||
makeRegistrationUrl={() => {throw new Error('Not implemented');}}
|
onTokenLoginCompleted={resolve}
|
||||||
/>, parentDiv,
|
initialScreenAfterLogin={getScreenFromLocation(windowLocation)}
|
||||||
);
|
makeRegistrationUrl={() => {throw new Error('Not implemented');}}
|
||||||
|
/>, 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
|
||||||
|
|
Loading…
Reference in New Issue